Namphibian opened a new issue #1459:
URL: https://github.com/apache/camel-quarkus/issues/1459
Hi Team.
Busy working on another example and came across the following error when
using the ```@Handler``` on a bean.
Route below:
```
@Override
public void configure() throws Exception {
camelContext.setMessageHistory(true);
fromF("timer:foo?period=%s", period)
.to("bean:greeterBean")
.to("log:example");
}
```
The bean definition:
```
@ApplicationScoped
@Named("greeterBean")
@RegisterForReflection
public class Greeter {
public String greet(Exchange exchange) {
return "greet hello world";
}
@Handler
public String say(Exchange exchange) {
return "say hello world";
}
}
```
The following exception is thrown.
```
org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous
method invocations possible: [public java.lang.String
org.acme.sedaInterceptLog.Greeter_ClientProxy.greet(org.apache.camel.Exchange),
public java.lang.String
org.acme.sedaInterceptLog.Greeter_ClientProxy.say(org.apache.camel.Exchange)]
on the exchange: Exchange[]
at
org.apache.camel.component.bean.BeanInfo.chooseMethod(BeanInfo.java:614)
```
Seems like ```@Handler``` is ignored completely.
If I change the bean definition to:
```
@ApplicationScoped
@Named("greeterBean")
@RegisterForReflection
public class Greeter {
@Handler
public String say() {
return "say hello world";
}
}
```
I get the following exception:
```
Caused by: [java.lang.IllegalStateException - No method invocation could be
created, no matching method could be found on:
org.acme.sedaInterceptLog.Greeter@946f731]
```
Is the ```@Handler``` annotation going to be used going forward? I can get
the example to work just wondering about the annotations going forward.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]