You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by J- <jm...@hotmail.com> on 2016/05/18 01:18:46 UTC

splitter parallel processing and setHeader or setProperty

Hi,

When doing "splitter" processing in parallel does it copy the entire exchange for each process?  I've noticed that after a splitter, i have a parallel process that calls a restlet like this:

from("direct:a").split(body(string.class).tokenize("\n").parallelProcessing(true).to("direct:from-splitter-parallel");

from("direct:from-splitter-parallel")
  .setHeader("name", simple("${body}"))
  .to("restlet:http://localhost/test/{name}");


and I've noticed that sometimes it will call the service with the same {name} twice, which leads me to believe the same exchange is used in the parallel process.  When i switch to non-parallel everything works fine.

Is there a way to put a lock or semaphore on a certain section of a rout?