You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2023/01/04 15:19:08 UTC
[GitHub] [camel-quarkus] turing85 opened a new issue, #4374: Integrate beans with qualifier io.smallrye.common.annotation.Identifier
turing85 opened a new issue, #4374:
URL: https://github.com/apache/camel-quarkus/issues/4374
Background:
[The usage of `@Named(...)` on injection points is discouraged by the Jakarta CDI standard](https://jakarta.ee/specifications/cdi/3.0/jakarta-cdi-spec-3.0.html#named_at_injection_point). This makes `@Named(...)` basically useless as qualifier for injection. Furthermore, [`@Named` interacts with `@Default` in unexpected ways](https://jakarta.ee/specifications/cdi/3.0/jakarta-cdi-spec-3.0.html#builtin_qualifiers).
An alternative to `@Named` provided by the smallrye ecosystem is [`@io.smallrye.common.annotation.Identifier`](https://github.com/smallrye/smallrye-common/blob/main/annotation/src/main/java/io/smallrye/common/annotation/Identifier.java), which is preferred by some quarkus developers (see, for example [this discussion in the quarukusio zulip chat](https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/.E2.9C.94.20ArC.20with.20named.20and.20unnamed.20beans)).
As of now, [`camel-quarkus` integrates with `@Named`](https://camel.apache.org/camel-quarkus/2.15.x/user-guide/cdi.html#_refer_to_a_bean_by_name), but not with `@identifier`. In the long run, it would be beneficial to also support integration of `@Identifier` beans.
---
Story:
**As** a user of the `camel-quarkus` extension
**When** I define a bean with `@Identifier("some-name")`
**Then** I want to be able to reference this bean in a camel context by its `@Identifier` `"some-name"`; just as if it were defined with `@Named("some-identifier")`.
---
Sample use case:
- Define a `ConnectionFactory` through a `@Produces` method with an `@Identfier(...)`-name (`"externally-defined"` in this example):
```
@Produces
@Typed({ ConnectionFactory.class })
@ApplicationScoped
@Identifier("externally-defined")
ActiveMQConnectionFactory externallyDefinedConnectionFactory(
@ConfigProperty(name = "artemis.externally-defined.url") String externallyDefinedUrl) {
return new ActiveMQConnectionFactory(externallyDefinedUrl);
}
```
- Use the `@Identifier(...)`-name (`"externally-defined"` in this example) in a route definition:
```
@Override
public void configuration() {
from(jms("queue:in").connectionFactory("externally-defined"))
.to(jms("queue:out").connectionFactory("externally-defined"));
}
```
--
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
[GitHub] [camel-quarkus] jamesnetherton closed issue #4374: Integrate beans with qualifier io.smallrye.common.annotation.Identifier
Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton closed issue #4374: Integrate beans with qualifier io.smallrye.common.annotation.Identifier
URL: https://github.com/apache/camel-quarkus/issues/4374
--
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
[GitHub] [camel-quarkus] jamesnetherton commented on issue #4374: Integrate beans with qualifier io.smallrye.common.annotation.Identifier
Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on issue #4374:
URL: https://github.com/apache/camel-quarkus/issues/4374#issuecomment-1408756310
> @jamesnetherton could you give an ETA in which version of `camel-quarkus` this feature will be integrated?
It'll be available in 2.17.0 towards the end of February.
--
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
[GitHub] [camel-quarkus] jamesnetherton commented on issue #4374: Integrate beans with qualifier io.smallrye.common.annotation.Identifier
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #4374:
URL: https://github.com/apache/camel-quarkus/issues/4374#issuecomment-1371066809
See also discussion on Camel zulip:
https://camel.zulipchat.com/#narrow/stream/257302-camel-quarkus/topic/Supporting.20.40Identifier.20annotation.20for.20named.20beans
--
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
[GitHub] [camel-quarkus] turing85 commented on issue #4374: Integrate beans with qualifier io.smallrye.common.annotation.Identifier
Posted by "turing85 (via GitHub)" <gi...@apache.org>.
turing85 commented on issue #4374:
URL: https://github.com/apache/camel-quarkus/issues/4374#issuecomment-1408700890
@jamesnetherton could you give an ETA in which version of `camel-quarkus` this feature will be integrated?
--
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
[GitHub] [camel-quarkus] turing85 commented on issue #4374: Integrate beans with qualifier io.smallrye.common.annotation.Identifier
Posted by "turing85 (via GitHub)" <gi...@apache.org>.
turing85 commented on issue #4374:
URL: https://github.com/apache/camel-quarkus/issues/4374#issuecomment-1426193582
@jamesnetherton There will be no `2.17` release for quarkus (and thus no `2.17` for `camel-quarkus`). Will this then be included in `3.0.0`?
--
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
[GitHub] [camel-quarkus] jamesnetherton commented on issue #4374: Integrate beans with qualifier io.smallrye.common.annotation.Identifier
Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on issue #4374:
URL: https://github.com/apache/camel-quarkus/issues/4374#issuecomment-1426380295
> Will this then be included in 3.0.0
Yes correct.
--
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