Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Unknown
Description
Currently, when we look up a mandatory bean which type we know, we perform the lookup with the bean's name and convert it to the requested type:
... public static <T> T mandatoryLookupAndConvert(CamelContext context, String name, Class<T> beanType) { Object value = lookup(context, name); if (value == null){ throw new NoSuchBeanException(name, beanType.getName()); } return convertTo(context, beanType, value); } ...
This leads to problem with the current implementation of https://github.com/apache/camel-quarkus/issues/4725, where we introduced automatic registration of beans annotated with @Identifier . When several beans with the same @Identifier("<name>") but different types are present. We think we can prevent this problem when we modify above method to do a lookup(...) with the type information, and only do the lookup(...) without type information if the lookup(...)with type information yielded no result.
FTR: relevant zulip chat
Attachments
Issue Links
- relates to
-
CAMEL-11862 Convert to requested type values retrieved from the repository
- Resolved
- links to