Recently, a “route group“ was added:

https://issues.apache.org/jira/browse/CAMEL-11669

The ticket mentioned that the route group is a “logical group” that one or
more routes are attached to. Some questions about this new feature:

1. Is the syntax still the same as in the ticket?
2. Is this already documented?
3. Is this also part of Camel 4? (The fixed version is 3.22.0. Probably
this also added to Camel 4)
4. Is there also an API for this feature (for example to retrieve the group
of a route, or to start/stop a complete group of routes). I have similar
functionality in Assimbly (a group of routes is called a flow there) and
would rather port this functionality to Camel 4 if if rich enough.

What I currently do to manage a group of routes is to have routeid that is
build up like this:

groupid_routeid

Then I can stop a group like this:

List<Route> routeList = getRoutesByFlowId(id);

for (Route route : routeList) {
    String routeId = route.getId();
    log.info("Stopping step | flowid=" + route.getId());
    routeController.stopRoute(routeId, stopTimeout, TimeUnit.SECONDS);
    context.removeRoute(routeId);
    if(route.getConfigurationId()!=null) {
       removeRouteConfiguration(route.getConfigurationId());
    }
}

The getRoutesByFlouwId gets the related routes for a group and then loops
them one by one. This however with large groups can take a while. Would be
nice to do something like this:

routeController.stopGroup("groupId")

Raymond

Reply via email to