Karaf Support

Apache Camel is designed to work nicely inside Apache Karaf OSGi container.

It includes:

  • Camel features descriptor allowing to easily and quickly install Camel in Karaf.
  • Karaf commands allowing you to view, start, stop, get info, about the Camel contexts and routes running in the Karaf instance.

It is recommended to use at least Apache Karaf 4.x with current Camel versions.

 

Install Camel in Karaf

Assuming that you have a running Karaf instance, you can register the Camel features descriptor:

Now, we have all Camel features available:

It is a good start to at least install camel-blueprint

You might need other features depending on what components you use in your routes. So for example if you use stream:out then you need the camel-stream feature.

Karaf commands

The camel commands below help managing your integrations. In many cases the commands support tab completion for context and route names.

Command

Description

camel:context-list

Lists the camel contexts available in the current Karaf instance

camel:context-info

Displays detail information about a given Camel context

camel:context-start

Starts the given Camel context

camel:context-stop

Stops the given Camel context (it becomes unavailable and it can't be started afterwards)

camel:route-list

Displays the list of Camel routes available in the current Karaf instance

camel:route-info

Provides detail information about a Camel route

camel:route-show

Renders the route in XML

camel:route-start

Starts the given route. From Camel 2.10 onwards you can use * as wildcard to match multiple routes.

camel:route-stop

Stops the given route. From Camel 2.10 onwards you can use * as wildcard to match multiple routes.

camel:route-suspend

Suspends the given route. From Camel 2.10 onwards you can use * as wildcard to match multiple routes.

camel:route-resume

Resumes the given route. From Camel 2.10 onwards you can use * as wildcard to match multiple routes.

camel:endpoint-list

Lists endpoints fromm all camel contexts available in the current Karaf instance

camel:route-profile

To profile route(s)

camel:route-reset-stats

To reset performance stats on the given route(s)

camel:context-suspend

Suspends the given Camel context

camel:context-resume

Resumes the given Camel context

 

camel:route-list

You can also filter the routes by CamelContext:

Tip: use the TAB key to completion on the CamelContext ID.

camel:context-info

Displays detailed information about a given CamelContext:

add the *--verbose* option (following the context name) to also list the endpoints

You can see the current Camel version used by the CamelContext, some context attributes, the components involved in the context, and the endpoints defined.

Tip: use TAB key for completion on the CamelContext name.

camel:route-info

The *camel:route-info* command provides detail information about a Camel route:

You can see some statistics (the number of processed exchanges, the processing time, etc) and a XML rendering of your route (whatever DSL used to define the route).

Tip: use TAB key for completion on the route name.

camel:route-show

The *camel:route-show* command renders the route in XML. It's independent from the DSL used to define the route:

Tip: use TAB key for completion on the route name.

camel:route-suspend

The *camel:route-suspend* command suspends a Camel route:

Tip: use TAB key for completion on the route name.

camel:route-resume

The *camel:route-resume* command resume a Camel route:

Tip: use TAB key for completion on the route name.

camel:endpoint-list

The *camel:endpoint-list* command displays the list of the endpoints available in all camel contexts of the current Karaf instance:

It displays the context name/ID (used in others commands), the URI of the endpoint and the current status (started/stopped).

 

© 2004-2015 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram