You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Pete Mueller <pe...@routecloud.com> on 2010/01/04 01:51:44 UTC

Way for a processor to spawn new exchanges

Hey all, 

I have an incoming message in an exchange that needs to be processed.  The
processing of this message may create more messages. This is not a spliting
action, in one case for example, data is analyzed and if the result of a
computation is > X, a new alert message needs to be sent down a different
camel route.

My question is: Is there a "standard" way for a processor (which has one
exchange with an in and out message) to create one or more new exchanges and
send it off on it's way.  If so, since this exchange is created internally,
and not from any component, how do you tell the exchange what route it is to
take?  Is this what "direct" or "seda" is used for?

thanks
-pete
-- 
View this message in context: http://old.nabble.com/Way-for-a--processor-to-spawn-new-exchanges-tp27007460p27007460.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Way for a message to spawn new processors

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

You can use the ProducerTemplate to send a new message to whatever 
endpoint that you want to send to in the processor.

Here is an example[1] in apache wiki.

[1] 
http://camel.apache.org/how-do-i-write-a-custom-processor-which-sends-multiple-messages.html

Willem

Pete Mueller wrote:
> Hey all, 
> 
> I have an incoming message in an exchange that needs to be processed.  The
> processing of this message may create more messages. This is not a spliting
> action, in one case for example, data is analyzed and if the result of a
> computation is > X, a new alert message needs to be sent down a different
> camel route.
> 
> My question is: Is there a "standard" way for a processor (which has one
> exchange with an in and out message) to create one or more new exchanges and
> send it off on it's way.  If so, since this exchange is created internally,
> and not from any component, how do you tell the exchange what route it is to
> take?  Is this what "direct" or "seda" is used for?
> 
> thanks
> -pete