You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "davsclaus (via GitHub)" <gi...@apache.org> on 2023/10/27 07:40:10 UTC

[I] Quarkus CDI add support for Primary beans [camel-quarkus]

davsclaus opened a new issue, #5464:
URL: https://github.com/apache/camel-quarkus/issues/5464

   ### Describe the feature here
   
   If Quarkus has a similar concept like Spring with @Primary beans then it would be good to add support for this too.
   
   Here is how we did this for camel-spring
   https://github.com/apache/camel/blob/main/components/camel-spring/src/main/java/org/apache/camel/spring/spi/ApplicationContextBeanRepository.java#L88
   
   The method `findSingleByType` needs to favour the @Primary bean if there are 2+ beans of the same type.


-- 
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-unsubscribe@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Quarkus CDI add support for Primary beans [camel-quarkus]

Posted by "mkouba (via GitHub)" <gi...@apache.org>.
mkouba commented on issue #5464:
URL: https://github.com/apache/camel-quarkus/issues/5464#issuecomment-1782658927

   I don't know how exactly the "primary beans" work but in Quarkus you can [inject multiple beans of the same type](https://quarkus.io/guides/cdi-reference#injecting-multiple-bean-instances-intuitively) with `@Inject @All List<Foo> foos`/`Arc.container().listAll()` and the list is sorted by priority as defined by `io.quarkus.arc.InjectableBean#getPriority()`; higher priority goes first.
   
   The `@jakarta.annotation.Priority` annotation can be used to assign the priority to a class bean, producer method or producer field. The priority is also honored if using the programmatic lookup via `jakarta.enterprise.inject.Instance`.


-- 
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-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Quarkus CDI add support for Primary beans [camel-quarkus]

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on issue #5464:
URL: https://github.com/apache/camel-quarkus/issues/5464#issuecomment-1782645684

   I think there is no such Primary beans in Quarkus. @mkouba is there any plan to add this support or similar way in Quarkus CDI?


-- 
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-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Camel 4.2.0] Quarkus CDI add support for Primary beans [camel-quarkus]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on issue #5464:
URL: https://github.com/apache/camel-quarkus/issues/5464#issuecomment-1785258928

   Yes its only a change for 4.2 onwards


-- 
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-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Quarkus CDI add support for Primary beans [camel-quarkus]

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on issue #5464:
URL: https://github.com/apache/camel-quarkus/issues/5464#issuecomment-1785083854

   @davsclaus It seem there are some changes in https://github.com/apache/camel/blame/main/core/camel-support/src/main/java/org/apache/camel/support/DefaultRegistry.java to override `public <T> T findSingleByType(Class<T> type)` method. So this funtionality should be only in camel `4.2.0-SNAPSHOT`?


-- 
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-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Camel 4.2.0] Quarkus CDI add support for Primary beans [camel-quarkus]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton closed issue #5464: [Camel 4.2.0] Quarkus CDI add support for Primary beans
URL: https://github.com/apache/camel-quarkus/issues/5464


-- 
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-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org