Hi, I have a subsidiary question: Is it possible to pass parameter to the bean method called ? Thanks, Sébastien.
James.Strachan wrote: > > 2008/9/9 Seb- <[EMAIL PROTECTED]>: >> >> Hi, >> I have problems imagining how camel can be used/integrated to route >> message >> depending on return from a service call. >> Let's say I have a file source endpoint that send messages to MyOwnRouter >> which routes them depending on the return from a call to a service >> (whatever >> may that be). >> In the examples provided in various documentation for Routing, the routes >> conditions are statically known at startup (when xpath(..)...) >> Do I need to write an own component ? Would a bean be enough ? Can I use >> the >> java DSL then ? > > You can dynamically invoke any expression and use the result of that > expression to determine what endpoints a message goes to. So you can > use things like a Dynamic Recipient List... > > http://activemq.apache.org/camel/recipient-list.html > > You can use any bean method to return the list of endpoints to send it > to; using Java as the expression language if you prefer. > > e.g. > > from("activemq:Foo").recipientList().methodCall("someBean", "myMethod"); > > Then you can use any Java code you like to take the input message & > headers and use any algorithm you can imagine to figure out where to > send the message. > http://activemq.apache.org/camel/bean-language.html > http://activemq.apache.org/camel/bean-integration.html > > -- > James > ------- > http://macstrac.blogspot.com/ > > Open Source Integration > http://open.iona.com > > -- View this message in context: http://www.nabble.com/Routing-depending-on-a-Service-tp19393604s22882p19436281.html Sent from the Camel - Users mailing list archive at Nabble.com.
