Closed turing85 closed 11 months ago
I raised https://issues.apache.org/jira/browse/CAMEL-19234 to tackle the issue in camel's core. I think it is possible to implement it in such a way that backwards-compatibility ca be ensured.
Issue has been fixed in camel
and is scheduled for release in 4.0.0-M3
. So it should automatically be "fixed" as soon as we produce a release on camel version >= 4.0.0-M3
.
Question is: how should we track that this issue has been resolve, i.ie when it is accessible to users?
how should we track that this issue has been resolved
I'll try to add a test case to verify it.
when it is accessible to users
It depends whether we do another milestone release (M2) for Camel Quarkus 3.x. Otherwise it'll be available when we release 3.0.0.
@jamesnetherton we already have some tests that (implicitly) test the behaviour here. We are currently in the process of migrating the tests to quarkus-3.x
(see this branch). We also plan to provide the entire camel-jms
test suite to camel-quarkus
(see https://github.com/quarkiverse/quarkus-artemis/issues/158).
Description
We added support to automatically register beans annotated with
@Identifier
in #4374 (commit https://github.com/apache/camel-quarkus/commit/6f4228848ef68eff290ef735d8552dcc23cf7266#diff-79ee191174431bde21e06eae2287b5a2e61d6a7b39a3e6d5915d5b2c2455f532) Bean registration fails, however, when multiple beans with different types have the same@Identifier("<name>")
.Example
Bean defining class:
Usage in route:
results in:
Expected behaviour
Bean is properly resolved through its type
Actual behavour
Application fails to start up with above exception
Analysis and possible solution
The problem is cased in
RuntimeBeanRepository
, because the bean is looked up without its type, thus two beans are found and the above exception is thrown.One possible solution would be to first try to get the bean with its type, and only if this fails get the bean without type and call the converter. Risk: it might be possible that some code relies on some converter call, even if conversion is not strictly necessary.
@jamesnetherton already did some experimentation here.
FTR: corresponding Zulip conversation.