This content has been marked as final.
Show 3 replies
-
1. Re: stopping a route within processor
njiang Oct 5, 2010 7:38 PM (in response to guest)You can do it from Camel 2.4.0. like this
<route id="myRoute"> <from uri="timer://PullTimer?fixedRate=true&period=1000"></from> <process ref="MyProcessor"></process> ... <!-- more stuff here--> ... </route>
public void process(Exchange exchange) throws Exception { // force stopping this route while we are routing an Exchange // requires two steps: // 1) unregister from the inflight registry (in Camel 2.5.0) // 2) stop the route getContext().getInflightRepository().remove(exchange); getContext().stopRoute("myRoute"); }
You can find more information about it in Camel in Action Chapter 13.
-
2. Re: stopping a route within processor
guest Oct 5, 2010 8:38 PM (in response to guest)Looks like the suggested fix actually stopped the route from kicking off totally. I'd like for it to just stop for that one instance.
-
3. Re: stopping a route within processor
davsclaus Oct 6, 2010 12:16 AM (in response to guest)There is a <stop/> in the DSL you can use.
Or you can set a header on the current Exchange. Exchange.STOP (I think thats key key) with the value Boolean.TRUE.