In the previous recipe you learned how to list OSGI features available for your ServiceMix installation. This recipe will show how to install the feature of your choice into the ServiceMix container.
For the purpose of this recipe, we will assume that you have your ServiceMix instance already installed and running.
The easiest way to install the desired feature is to use the Apache Karaf console bundled with ServiceMix. After you open the console, list the features available for installation. The way to list features that can be installed into your ServiceMix container is described in the previous recipe.
Connect to your container using the interactive ServiceMix console.
In the ServiceMix console, type the
feature:install featureName
command
ServiceMix uses features to group OSGI bundles into logical modules. When you install a given feature, Karaf retrieves all the necessary bundles from the feature repository. Downloaded artifacts are held in the SERVICEMIX_HOME/data/cache
directory. For example, if you want to use the jibx
data format in your application's routes, type feature:install camel-jibx
. This command tells ServiceMix to download the feature and all the related bundles from the Camel features repository and install it into your container.
Working with the features listings can be difficult due to the high number of options available for the installation. The following hints will guide you through some of the tricks that will make browsing through the features listings easier.
One of the very useful features of the Apache Karaf console is its tab-completion abilities. For example, if you want to know what Camel features are available for installation, you can type feature:install camel-
and then press the Tab button. You should see an output similar to the following listing:
karaf@root> features:install camel- camel-ahc camel-atom camel-aws camel-bam camel-bean-validator camel-bindy camel-cache camel-cometd camel-context camel-crypto
If you are curious about which bundles are included in the feature, you can use the features:info ServiceMix
command to retrieve this kind of information. For example, to list details of the camel-cxf
feature, issue the features:info camel-cxf
command in the Karaf console.