Hi

Use a header to set the UUID if it has to be per message specific.
The property is shared on a single Exchange which is used during the
entire routing of the incoming message that started it all.



On Wed, Aug 29, 2012 at 7:43 AM, sushil_vsk5 <sushil_v...@yahoo.co.in> wrote:
> I have a route which has a splitter which splits some message into chunks and
> for each chunk, it invokes another route using the 'direct' endpoint
> This second route is configured as below -
>
> from("direct:xxx")
>  .setProperty("uuid",
> simple(getContext().getUuidGenerator().generateUuid()))
>   .process(new Processor() {
>      public void process(Exchange exchange) throws Exception {
>         System.out.println(exchange.getProperty("uuid"));
>     }
> });
>
> My problem is that for each split, I would be expecting that the UUID
> property would be having a different value but it seems that it always ends
> up having the same value. So if the original message had 4 chunks, then this
> route gets invoked 4 times but ends up having the same value for the
> property 'uuid'. I am not able to understand this behaviour. If I set this
> property within a Processor though, it works fine without any problems.
>
> Am I missing something here?
>
> Regards,
> Sushil
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Java-DSL-setProperty-behaviour-tp5718226.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to