Hi,
I am very new to Camel framework and I want to configure the default error
channel.
In the following code I am trying to rediect failed exchanges to the
mock:err endpoint but this does not work. 

        public void testException() throws Exception{
                DefaultCamelContext ctx = new DefaultCamelContext();
                ctx.addRoutes(new RouteBuilder(){
                        @Override
                        public void configure() throws Exception {
                                errorHandler(deadLetterChannel("mock:err"));
                                from("seda:a").process(new Processor(){
                                        public void process(Exchange exchange) 
throws Exception {
                                                throw new Exception("Test 
exception");
                                        }
                                });
                        }
                });
                
                MockEndpoint mock = (MockEndpoint) ctx.getEndpoint("mock:err");
                mock.expectedMessageCount(1);
                
                ctx.start();
                CamelTemplate<Exchange> template = new 
CamelTemplate<Exchange>(ctx);
                template.sendBody("seda:a", "Test message");
                mock.assertIsSatisfied();
                ctx.stop();
        }


I am using camel 1.2.0 and I noticed the issue
(https://issues.apache.org/activemq/browse/CAMEL-191) but I dont know
whether the test failure is related to it.

Please can you tell me if I'am missing something?


Thanks.
-- 
View this message in context: 
http://www.nabble.com/DeadLetterChannel-endpoint-configuration-tf4811039s22882.html#a13765211
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to