For this, I have used a RoutePolicy. This lets me stop the route after the
exchange is finished.
My code looks like this (snippets):
public class MyRoutePolicy extends RoutePolicySupport
{
@Override
public void onExchangeDone(Route pRoute, Exchange pExchange)
{
super.onExchangeDone(pRoute, pExchange);
//log.info("Exchange just finished, updating route states if
necessary.");
if(shouldStopRoute())
{
Consumer routeConsumer = pRoute.getConsumer();
log.info("Stopping route: " + pRouteName);
stopConsumer(routeConsumer);
}
}
}
...where "stopConsumer()" is a method of
org.apache.camel.impl.RoutePolicySupport
Hope this helps!
JB
On 5/30/14 4:28 PM, "rkjoshi2" <[email protected]> wrote:
>Hi Jeff,
>
>Thank you for the reply, I am new to camel world. So could you please help
>me with code.
>
>Do you suggest something like this :
>
>route.getConsumer().stop()
>
>Thanks,
> Ravi
>
>
>
>--
>View this message in context:
>http://camel.465427.n5.nabble.com/Still-waiting-for-shutdown-of-1-message-
>listener-invokers-tp5751762p5751765.html
>Sent from the Camel - Users mailing list archive at Nabble.com.