RoutePolicy - set route suspended if idle for 10 seconds.
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.