Inject a new exchange based on event

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Inject a new exchange based on event

aruch
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
Reply | Threaded
Open this post in threaded view
|

Re: Inject a new exchange based on event

aruch
Upon further investigation, I don't think that I can write my own processor by extending MulticastProcessor. Can I have a constructor that accepts a destination processor as an argument? I don't think I have access to that in Spring. Am I missing something?

Thanks,
Andy



aruch 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