camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Seb- <seba.pub...@gmail.com>
Subject Re: Routing depending on a Service
Date Thu, 11 Sep 2008 15:39:35 GMT

Hi Hadrian,
Sure I have access to Exchange/Body/...
But I was looking for something like this:

from("activemq:Foo").recipientList().methodCall("someBean", "myMethod",
"some", "parameters", ...);

Thanks,
S├ębastien.


Hadrian Zbarcea wrote:
> 
> Hi,
> 
> Sure you can:
> 
> 
> Did you look at:
> http://activemq.apache.org/camel/bean-integration.html
> 
> The bean has access to the Exchange, so all the arguments should be  
> there, either in the header or the body.
> 
> What kind of parameters are you thinking of?
> 
> Cheers,
> Hadrian
> 
> On Sep 11, 2008, at 10:36 AM, Seb- wrote:
> 
>>
>> 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- <seba.public@gmail.com>:
>>>>
>>>> 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.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Routing-depending-on-a-Service-tp19393604s22882p19437717.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message