zhfeng commented on code in PR #7261: URL: https://github.com/apache/camel-quarkus/pull/7261#discussion_r2043433386
########## extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeBeanRepository.java: ########## @@ -80,6 +81,17 @@ private static <T> Set<T> getReferencesByType(BeanManager manager, Class<T> type private static <T> Optional<T> getReferenceByName(BeanManager manager, String name, Class<T> type) { Set<Bean<?>> beans = manager.getBeans(name); + // If it is a Synthetic bean, it should match with type + beans = beans.stream() + .filter(bean -> { + if (bean instanceof InjectableBean injectableBean) { + return !injectableBean.getKind().equals(InjectableBean.Kind.SYNTHETIC) + || bean.getTypes().contains(type); + } else { + return true; + } + }).collect(Collectors.toSet()); + Review Comment: @jamesnetherton @ppalaga I replace to check the beans which are generated by the extensions are `SYNTHETIC`. We don't need to introduce a `NamedAnnotationLiteral` build item. The `EntityManagerFactory` class from `quarkus-hibernete-orm` is also with `@Named` annotation. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org