You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Coder One <co...@yahoo.com> on 2008/11/20 18:15:44 UTC

RecipientList & Bean Continuing Route

from("jms:myqueue").to("bean:eventListener?methodName=process").recipientList(???)..

My event Listener returns a string of comma delimiter route URI, say, jms:q1, jms:q2, etc...and now I would like to further route the event to all the q1, q2, etc...

q1, q2, come from database keyed by the event...

Is recipientList the right way?  How?

Thanks...



      


Re: RecipientList & Bean Continuing Rou

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Nov 20, 2008 at 6:23 PM, Coder One <co...@yahoo.com> wrote:
> Beautiful....I did not know about that body() call.  This stuff is powerful!!! :)
>
> Thanks for all your help!
Yeah it grows on you ;)

A trick to learn is to avoid using parameters but rely on the fluent
builder, since when you place a dot and press ctrl + space to get the
method list from your IDE then the list shows what you can do

So you can do:
...recipientList().CURSOR HERE

And then press ctrl + space and you should get the body() in the list to choose

If using parameters instead then you just get a hint that it should be
a Expression type and then it's much hard to figure out what to
insert.


/Claus

Re: RecipientList & Bean Continuing Rout

Posted by Coder One <co...@yahoo.com>.
Beautiful....I did not know about that body() call.  This stuff is powerful!!! :)

Thanks for all your help!


--- On Thu, 11/20/08, Claus Ibsen <cl...@gmail.com> wrote:

> From: Claus Ibsen <cl...@gmail.com>
> Subject: Re: RecipientList & Bean Continuing Rout
> To: camel-user@activemq.apache.org, coder_lol@yahoo.com
> Date: Thursday, November 20, 2008, 9:21 AM
> Hi
> 
> The dynamic recpient list is documented here
> http://activemq.apache.org/camel/recipient-list.html
> 
> It has a sample how to use a tokenizer to split a string
> based on
> comma. Just used body() instead of header
> from("jms:myqueue").to("bean:eventListener?methodName=process").recipientList(body().tokenize(","));
> 
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
> 
> 
> 
> On Thu, Nov 20, 2008 at 6:15 PM, Coder One
> <co...@yahoo.com> wrote:
> >
> from("jms:myqueue").to("bean:eventListener?methodName=process").recipientList(???)..
> >
> > My event Listener returns a string of comma delimiter
> route URI, say, jms:q1, jms:q2, etc...and now I would like
> to further route the event to all the q1, q2, etc...
> >
> > q1, q2, come from database keyed by the event...
> >
> > Is recipientList the right way?  How?
> >
> > Thanks...
> >
> >
> >
> >
> >
> >


      


Re: RecipientList & Bean Continuing Rout

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

The dynamic recpient list is documented here
http://activemq.apache.org/camel/recipient-list.html

It has a sample how to use a tokenizer to split a string based on
comma. Just used body() instead of header
from("jms:myqueue").to("bean:eventListener?methodName=process").recipientList(body().tokenize(","));

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Thu, Nov 20, 2008 at 6:15 PM, Coder One <co...@yahoo.com> wrote:
> from("jms:myqueue").to("bean:eventListener?methodName=process").recipientList(???)..
>
> My event Listener returns a string of comma delimiter route URI, say, jms:q1, jms:q2, etc...and now I would like to further route the event to all the q1, q2, etc...
>
> q1, q2, come from database keyed by the event...
>
> Is recipientList the right way?  How?
>
> Thanks...
>
>
>
>
>
>