Archer
Archer

Reputation: 5147

Bean method invocation: dynamic way

I'd like to dynamically invoke bean method depending on some header value:

This seems doesn't work: <to uri="bean:myBean?method=${in.header.methodName}&amp;multiParameterArray=true"/>

Any ideas?

Upvotes: 1

Views: 1125

Answers (2)

Claus Ibsen
Claus Ibsen

Reputation: 55535

See this FAQ

From Camel 2.16 its easier as you can use <toD .. which is the dynamic-to. In older releases you can use the recipient list EIP. Its all explained in that FAQ.

Upvotes: 1

smarquis
smarquis

Reputation: 540

You can just set the method name in the header called "CamelBeanMethodName" and route your message to "bean" without specifying any method.

Upvotes: 2

Related Questions