camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: How can I handle exception message?
Date Tue, 06 Dec 2011 06:50:37 GMT
Use exchange.getIn() to access the message.



On Tue, Dec 6, 2011 at 7:34 AM, focaldi <ferit.ocaldi@tav.aero> wrote:
> Hi,
>
> I want to do some special thing according to Exception Type. But there are a
> lot of route and when an exeption occured I send the message to deadletter
> queue.
>
>        errorHandler(
>                        deadLetterChannel("jms:queue:deadletterqueue")
>        );
>
> I wrote a class for deadletterchannel processor.
>
> @Component("ProcessorForSendingEmail")
> public class ProcessorForSendingEmail implements Processor {
>
>        @Override
>        public void process(Exchange exchange) {
>
>                System.out.println("HATAAAAAAAAAA :"+exchange.getOut().isFault());
>                System.out.println("YYYYYYYYYYYYY
> :"+exchange.getOut().getHeader(Exchange.EXCEPTION_CAUGHT));
>                System.out.println("FFFFFFFFFFFFF :"+exchange.getException());
>                System.out.println("HATAAAAAAAAAA :"+exchange.getIn().isFault());
>                System.out.println("YYYYYYYYYYYYY
> :"+exchange.getIn().getHeader(Exchange.EXCEPTION_CAUGHT));
>
>        }
>
> }
>
>
> But all of them is null... I need to write Exception Message... How can I
> reach exception message in Dead Queue. Thanks...
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-can-I-handle-exception-message-tp5051151p5051151.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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

Mime
View raw message