What if I want to add other values to the header that i cannot initialize?
I have looked at the example "Example using handled" here:
http://activemq.apache.org/camel/exception-clause.html
and I don't see the difference. In the example a customerid is added to the
header without initializing it first.


Claus Ibsen wrote:
> 
> Hi
> 
> Id is null because the exchange that is caught by onException is a
> snapshot of the exchange just before your bean listTransformer is invoked. 
> 
> Any changes to the exchange that happens in listTransformer is not
> effective/visible for the error handler.
> 
> You can use 2 bean calls to let the id be visible
>               from(fromRoute)
>               .beanRef("listTransformer", "initId")
>               .beanRef("listTransformer", "fromStringToFundList")     
> .to("bean:fundListDao?methodName=save");                      
> 
> For instance a initId() method that is simple and just set the id.
> 
> Then if there is a failure in the 2nd bean then the snapshot is from just
> before the 2nd bean call.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Error-Handler-and-OutHeaders-tp19970966s22882p19971372.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to