camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roman Kalukiewicz" <roman.kalukiew...@gmail.com>
Subject Re: exception trace in message
Date Thu, 28 Feb 2008 22:04:30 GMT
2008/2/28, cmdr <spcmdr@yahoo.fr>:
>
>  Hi

Hello!

>  I would like to send messages with exception trace
>
>  exception(Exception.class).to("activemq:queue:Exception");
>
>  from(XXX)
>  .process(new Processor()
>  {
>    public void process(Exchange exchange) throws Exception
>    {
>       throw new Exception("Processing Exception");
>    }
>  })
>  .to(XXX)
>
>  I would like the activemq message to contain the exception message

It looks that this exception is already associated with the exchange
as a property named 'CamelCauseException'.
What I think you should try, is to add

.setHeader("exception", header("CamelCauseException"))

to your exception handlig flow, so it will be used as an 'exception'
property on JMS message. If it doesn't work you can try to explicitely
use processor to extract the stacktrace from the exception.

BTW. Maybe we could have converter toString(Throwable) to make it easier?

Roman

Mime
View raw message