Hi,

The exception is stored in the properties of exchange.
You can get it by using below code

Throwable exception = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Throwable.class);

On Tue Dec  6 14:34:10 2011, focaldi 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.



--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Reply via email to