camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Bauhan <>
Subject 2 Error Handlers called for 1 exception
Date Mon, 04 Apr 2016 19:16:55 GMT

I have a problem with the current Camel version 2.16.2. In version 
2.15.5 it works without problems.


I want to test the throwing of an exception when no response message is 
received within a given timeout.

To create a timeout, I use multicast to clone the message and a delay to 
wait for a response.

The Timeout route looks like:
                         .errorHandler(noErrorHandler()) // propagate 
exceptions to caller route

The messages come from the route:
                         .errorHandler(noErrorHandler()) // propagate 
exceptions to caller route
                         .split().method(send_controller, "split")
getInternalSendUri());  // shortcut for response messages

The timeout handler works as expected and sends an exception back 
through the route to the external caller.

In the test class I defined an error handler for the exception in the 
test route:
                 ExceptionTestProcessor exc_proc = new 

In the log I can see that the error handler receives the exception. But 
also the DefaultErrorHandler is called although I told "handled(true)":
[                          main] ExceptionTestProcessor WARN  Exception 
caught: No response received within timeout time!
[                          main] DefaultErrorHandler ERROR Failed 
delivery for (MessageId: ID-smdw7601-46612-1459795682397-1-1 on 
ExchangeId: ID-smdw7601-46612-1459795682397-1-2). Exhausted after 
delivery attempt: 1 caught: 
de.dfs.camel.component.atsm.MessageSendException: No response received 
within timeout time!. Processed by failure processor: 


Message History
RouteId              ProcessorId Processor Elapsed (ms)
[route1            ] [route1            ] [direct://message-in ] [      
[route1            ] [to7               ] [atsm:message-in ] [      1127]
[ats-m:message-in  ] [process10         ] [Processor@0x148f152 ] 
[        17]
[ats-m:message-in  ] [process11         ] [Processor@0x1db6621 ] 
[         1]
[ats-m:message-in  ] [split1            ] 
method=split}]         ] [      1095]
[                  ] [process14         ] [Processor@0xe64498 ] [         1]
[                  ] [to6               ] [mock:sendException ] [         1]

Can someone give me a hint, why the DefaultErrorHandler is called?


I also tested the receiption of the error message at the endpoint:
         final MockEndpoint send_exc = 

Is there something like "send_exc.expectedException(...)" I could use to 
check for the correct exception?


View raw message