How to stop camel route intermediately while processing ?

Solution Unverified - Updated -

Issue

  • While using camel routes to process the messages, An issue is observed with stopping the route and the following are the details:

  • Configuration of the route is as following:

from("jms:queue:queue1 ? concurrentConsumers = 5 & maxConcurrentConsumers = 25 & maxMessagesPerTask=25") 
                        .transacted() 
                        .process(new Processmyprocess()) 
                       .to("jms:queue:queue2"); 
  • There are thousands of messages in side the queue1 to be processed, the route is processing the messages from "queue1" in between Is it possible to stop the route.

  • Tried configuring the "ShutdownStrategy" as following

camelContext.getShutdownStrategy().setTimeout(2);
  • For stopping the route following API is being used:
camelContext.stopRoute(routeId);
  • Still unable to stop the route with in 2 seconds. For stopping of the route it is taking 300 seconds (Default Configuration).

Environment

  • JBoss Fuse
    • 6.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.