jamesnetherton commented on code in PR #6304:
URL: https://github.com/apache/camel-quarkus/pull/6304#discussion_r1698089162


##########
extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeBeanRepository.java:
##########
@@ -163,8 +165,13 @@ public <T> T findSingleByType(Class<T> type) {
             } else {
                 handles = container.listAll(type);
             }
+
             if (handles.size() > 0) {
-                return handles.get(0).get();
+                if (handles.stream().filter(h -> 
!h.getBean().getKind().equals(InjectableBean.Kind.SYNTHETIC)).count() > 0) {

Review Comment:
   > introduce a new Comparator if priority is the same, the default bean is 
win?
   
   Yeah, sounds ok.
   
   Probably faster than the alternative, which would be to collect all 
priorities in a set and then check the size.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to