I have context level defined error handling (retry interval and retry
attempts defined) that I am trying to test out.  Yet it will never be
invoked no matter how I simulate the error with mock end points.  Does
anyone how this can work?

Given my route I'm testing just looks like:

from(myQueue).to("bean:myBean?method=processOrder")

Here's what I've tried:

Insert advice to skip send to bean endpoint, and send to mock:myBean
instead.  Have mock:myBean throw an exception.  Error handler is NOT invoked
(I can see no retry attempt at all in the logs).

Override (via Spring injection) the bean endpoint with mock:myBean.  Have
mock:myBean throw an exception.  Error handler is NOT invoked.

In either above attempts, also tried setting the exception off the Exchange
object (i.e. exchange.setException), instead of throwing an exception
explicitly (what's the difference anyway?), again no luck, error handler not
invoked.

Here's what WORKS:

When NO mock end point is involved, i.e. my original bean endpoint throws a
null pointer exception, I can see error handler working.


Any ideas?

Thanks! 




--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-mock-end-points-and-testing-error-handling-tp5741050.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to