The OSGI bundles do not form a loose set of elements without any specified structure. In order to organize bundles into bigger logical packages, ServiceMix provides the notion of a feature. A feature is a logical module containing a set of related artifacts. In this recipe, you will learn how to list features that are available for your ServiceMix installation. By selecting which of the features to install (or uninstall), the administrator can easily control which blocks of functionality are available for the container.
Before you list the features available for your ServiceMix instance, you must connect to it with the interactive console.
Connect to ServiceMix with the interactive Karaf console.
In the Karaf shell, type the
features:list
command.
After you issue the features:list
command, you should see results similar to the following output:
karaf@root> features:listState Version Name Repository Description [installed] [2.2.4] karaf-framework karaf-2.2.4 [uninstalled] [2.5.6.SEC02] spring karaf-2.2.4 [uninstalled] [2.5.6.SEC02] spring-web karaf-2.2.4 [installed] [3.0.6.RELEASE] spring karaf-2.2.4 [uninstalled] [3.0.6.RELEASE] spring-aspects karaf-2.2.4
As you can see, the features:list
command displays features available for your ServiceMix instance. If you take a closer look at the resulting output, you will see that a feature is identified by the name and the version (this is an identity technique similar to the one used in the OSGI bundles versioning). As you can also notice, features are located in the repositories (the last column of the listing tells you the name of the repository in which the feature is located). And last but not least, the very first column of the discussed listing indicates whether the given feature has been already installed in your ServiceMix container or not.
At first glance, you may be overwhelmed by the amount of the features available for your ServiceMix instance. The following hints may be useful to work efficiently with the features listings.
If you feel overwhelmed by the amount of features available for the installation (and you likely will), use the grep
command to narrow down the results to the features you are interested in. For example, if you need to transform incoming messages to the CSV (Comma Separated Values) data format, type the features:list | grep csv
command. Also keep in mind that adding the -i
option to the grep
command tells ServiceMix to filter results regardless of the letter case of the output generated by the execution of the feature:list
command.