On Sun, Jan 18, 2009 at 12:08 PM, Woody Dickson <woodydick...@gmail.com> wrote: > Hi, > > One of the example has this: > > from("timer://pollTheDatabase?delay=30000").to("ibatis:selectAllAccounts").to("activemq:queue:allAccounts"); > > What I want to do is > > > <route> > <from uri="activemq:topic://mytopic"/> > <to uri="ibatis:selectTopicName"/> > <multicast> > > <recipientList> > <deliminter=","/> > </recipientList> > </multicase> > </route> > > From the selectTopicName, I can have an sql that will generate > activemq:topic://topicA,activemq:topic://topicB,activemq:topic://topicC > as the outcome. > > But how do I specify the outcome of the "ibatis:selectTopicName" to be > used in recipientList? > > I am newbie to camel and activemq, could someone please give me some pointers? > > Could someone please show me an example how that can be done? > > Any suggestion will be greatly appreciated. A good place to look is the recipient EIP pattern wiki: http://activemq.apache.org/camel/recipient-list.html
It was recently updated documenting how it computes the list of receivers. It should be something that can be iterated, such as a List<String> or the likes. If whatever iBatis returns isn't that you can use a processor to convert it in Java code > <from uri="activemq:topic://mytopic"/> > <to uri="ibatis:selectTopicName"/> <processRef ref="mySpringBeanThatIsAProcessor"/> > <multicast> > > <recipientList> > <deliminter=","/> > </recipientList> > </multicast> And then you can have a class that implements org.apache.camel.Processor where you can set the List<String> as the IN body yourself. > > Best Regards, > Woody > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/