Search code examples
apache-camelkaraf

Karaf script to suspend all started camel routes


I would like to create a command in Karaf to suspend all Camel routes that are currently Started. Similarly, I will have another script to resume all suspended routes.

My thought was to do something like:

each (camel:route-list | grep Started) { camel:route-suspend $route }

My first problem is that camel:route-list does not return values

Any help would be greatly appreciated.


Solution

  • The current Camel Karaf commands cannot do this. I logged a ticket to see if we can improve this in a future Apache Camel release.

    So the answer is: this is not possible with the script above. You would need to write your own Camel commands and install in Karaf that can do that.