RoutePolicy - set route suspended if idle for 10 seconds.

Solution Verified - Updated -

Issue

  • I'd like to have a route started in a suspended state.
  • For now I wrote a RoutePolicy with the "onStart" method overrided like this :
@Override
public void onStart(Route route) {
      try {
            suspendRoute(route);
      } catch (Exception e) {
            log.error("Cannot suspend route " + route.getId(), e);
      }
}
  • Is this the right way to do so ?
  • Also, when I look at my hawtio console, the route appears as started, not suspended. Why ?
  • The next step would be for this context to automatically return to the suspended state once the job is done (no more messages consumed for x seconds).

Environment

  • Red Hat Fuse
    • 6.3.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content