camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Problem with bean overloaded method invocation in route
Date Sun, 22 Aug 2010 07:12:20 GMT
Hi

You can add @Handle annotation to let camel know which method you want 
it to pick.

You can find more detail information from the section4.4.2 of Camel in 
Action.

Willem

senthil.arumugam wrote:
> Hi,
> 
> I am trying to invoke a method from my route configured with camel-spring to
> persist the consumed message to DB.
> 
> my route is like,
> <camel:route>
>   <camel:from uri="queue:foo" />
>   <camel:bean ref="foo" method="save" />
>   <camel:to uri="queue:foo-saved" />
> </camel:route>
> 
> The bean class Foo has two methods, which are overloaded.
> 
> e.g.
> 
> public void save(Collection<Foo> foos) {}
> 
> public void save(Foo foo) {}
> 
> When the consumer starts listening to the message, I am getting
> AmbiguousCallException. 
> 
> I can change my method name and make it works. But I would like to know if
> there were more elegant way to handle this.
> 
> Thanks in advance.
> 
> - SK


Mime
View raw message