On Tue, Sep 8, 2009 at 11:09 PM, Chris Audley<[email protected]> wrote: > I need to create a processor that takes a single message and results in > two separate messages with unique headers for each message. My plan is > to use the headers to dynamically route each result message to the > appropriate JMS queue. > > I want to be able to use this processor in a route configured via > Spring. > > I was trying to do this with a bean implementation, but it looks like > beans can only send the same message to multiple destinations with the > @RecipientList annotation. Is there something I can use that I missed? > > I've been digging through the code of MulticastProcessor and Splitter to > figure out how these work. It looks like the only way I can accomplish > what I want is to subclass MulticastProcessor so I can create two > ProcessorExchangePairs, each with the same destination processor (like > Splitter) but then I can create unique messages and headers for each > exchange. > > But I don't think I can use a subclass of MulticastProcessor in my > Spring configuration, it needs to destination processor as a constructor > argument. > > Is there some other approach I'm not seeing? >
You can use the ProducerTemplate from a processor to create and send a new message. And you can send as many as you like. And you can use it from a Processor too. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
