Hi
If the next processor is able to consume such as "direct" or "seda"
endpoints then you can
just send the 2ND exchange to that.
from(x).process(mySpecialProcessor).to(direct:a).to(zzz)
And MySpecialProcessor implements Processor {
public void process(Exchange exchange) {
// if special condition
ProducerTemplate template =
exchange.getCamelContext().createProducerTemplate();
template.start();
template.send("direct:a", myNewExchange)
template.stop();
}
Ahhh there is this FAQ
http://camel.apache.org/how-do-i-write-a-custom-processor-which-sends-multiple-messages.html
And this FAQ about you should invoke stop() on producer template when finished:
http://camel.apache.org/why-does-camel-use-too-many-threads-with-producertemplate.html
On Tue, Feb 3, 2009 at 1:17 AM, aruch <[email protected]> wrote:
>
> Hello,
>
> I'm using Camel 1.5.
>
> I'm trying to find the best way to inject a new exchange based on the
> existing exchange. For example, I have a processor. When the processor
> receives an exchange and if the exchange matches the criteria, I would like
> to send the original exchange AND a completely new exchange to the next
> processor.
>
> The closest example I can find is the Splitter processor, which gains this
> functionality by extending the Multicast processor. Is extending the
> Multicast processor the best/only way to do this? Isn't multicast designed
> to send one exchange to multiple endpoints, not multiple exchanges to one
> endpoint?
>
> Will I be able to extend MulticastProcessor and still use Spring to create
> my routes using the <bean> element?
>
> Thanks,
> Andy
> --
> View this message in context:
> http://www.nabble.com/Inject-a-new-exchange-based-on-event-tp21801537s22882p21801537.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
--
Claus Ibsen
Apache Camel Committer
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/