We'll revist this in Camel 3.0 where applying interceptors/error handlers and the likes is more flexible and applied dynamic at runtime.
The issue is the stop route causes side effect on the other adviced routes. On Mon, Jan 10, 2011 at 4:54 PM, John <john.fans...@ateb.com> wrote: > > Hi, > > I'm running 2.6-SNAPSHOT. > > I have a route builder that sets up a number of routes. One of the routes is > a timer route. > > For my unit tests, I would like to stop the timer route so that it doesn't > fire. Unfortunately when I stop the timer route, it appears to impact the > overall error handler. > > An example of my route builder is: > > public void configure() throws Exception { > errorHandler(deadLetterChannel("direct:emailSupport") > .maximumRedeliveries(2) > .redeliveryDelay(0)); > > from("direct:emailSupport") > .routeId("smtpRoute") > .errorHandler(deadLetterChannel("log:dead?level=ERROR")) > .to("smtp://smtpServer"); > > > from("timer://someTimer?delay=15000&fixedRate=true&period=5000") > .routeId("pollRoute") > .to("log:level=INFO"); > > from("direct:start") > .routeId("TestRoute") > .to("seda:foo"); > } > }; > > I am attempting to test the "TestRoute" and the error handler. In the test > itself, I intercept and throw an exception on the seda end point. I also > intercept the smtp endpoint with a mock. > > I expect the exceptions thrown on the seda endpoint to go through the error > handler and eventually hit the smtp endpoint when the retries are exhausted. > > If I stop the "pollRoute" before running my test, I get an error: > java.lang.IllegalStateException: SendProcessor has not been started: > sendTo(Endpoint[direct://emailSupport] InOnly) > > Everything works as expected if I leave the timer route running. > > If you have any ideas on what may be going on here, I'd appreciate it! > > Thanks, > > -john > -- > View this message in context: > http://camel.465427.n5.nabble.com/errorHandler-when-stopping-routes-in-test-tp3335015p3335015.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/