The DSL for 1 looks OK.  The DSL for option 2 should be using 
exchangeProperty.ROUTE_ID instead of property.ROUTE_ID if your Camel version is 
2.15 or later.

Can you share routes so we can see the details?


> On Apr 5, 2017, at 7:21 AM, Amruta Jawlekar <[email protected]> wrote:
> 
> I have similar requirement. I am setting property in the starting route, and
> I need to get that property value at the end of the route and compare it
> with its value in order to forward to different routes.
> 
> Basically, I have different routes to poll to different folder location, the
> middle processing of files is same and end route is different. I need to see
> from which route the exchange has come, so as to forward to appropriate
> route at the end.
> 
> I tried both -
> 1)
> <camel:setHeader headerName="routeId">
>       <camel:simple>${in.headers.ROUTE_ID}</camel:simple>
> </camel:setHeader>
> 
> and then inside choice - <camel:simple>${header.routeId} ==
> 'value'</camel:simple>
> 
> 
> 2)
> <camel:simple>${property.ROUTE_ID} == 'value' </camel:simple>
> 
> In both the cases it is not able to retrieve the value, as this condition is
> never getting true and the expected route is not getting executed.
> 
> Could you please help?
> 
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-long-do-the-camel-headers-live-in-routes-tp474477p5797014.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to