You create a simple route for each processor and then use multicast or
recipientlist
http://camel.apache.org/multicast.html
Something like this:
from("direct:endpoint")
.throttle(Long.parseLong(routeParams.get(RouteParam.THROTTLE)))
.setBody().body(PaymentRequest.class)
.parallelProcessing()
.thread(4)
.setHeader(ORIGINAL_REQUEST).javaScript("request.body")
.convertBodyTo(PaymentRequest.class)
.multicast().parallelProcessing().to("direct:processor1route",
"direct:processor2route");
from("direct:processor1route")
.process(processor1) ;
from("direct:processor2route")
.process(processor2) ;
And so on.
Van: Sachin [via Camel] [[email protected]]
Verzonden: vrijdag 26 april 2013 14:26
To: Wuyts Diether
Onderwerp: Processors in parallel mode
Hi ,
When we set parallel processing in a route, do all processors run in parallel
or in sequence?
MY requirement is that i have 5-6 processors in my route and i want then to be
executed in parallel even for a single message, how can i achieve this?
from("direct:endpoint")
.throttle(Long.parseLong(routeParams.get(RouteParam.THROTTLE)))
.setBody().body(PaymentRequest.class)
.parallelProcessing()
.thread(4)
.setHeader(ORIGINAL_REQUEST).javaScript("request.body")
.convertBodyTo(PaymentRequest.class)
.process(processor1)
.process(processor2)
.process(processor3)
.process(processor4)
.end()
If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Processors-in-parallel-mode-tp5731613.html
To start a new topic under Camel - Users, email
[email protected]
To unsubscribe from Camel - Users,
click here.
NAML
--
View this message in context:
http://camel.465427.n5.nabble.com/Processors-in-parallel-mode-tp5731613p5731614.html
Sent from the Camel - Users mailing list archive at Nabble.com.