Book Image

Instant Apache ServiceMix How-to

By : Henryk Konsek
Book Image

Instant Apache ServiceMix How-to

By: Henryk Konsek

Overview of this book

<p>Creating reliable integration solution can be easy if you choose the right tools for the job. Apache Camel and ServiceMix are the leading integration technologies dedicated to dealing with the complexity of the messaging solutions. Learn how to efficiently integrate multiple systems with bleeding edge open source Apache software.</p> <p>"Instant Apache ServiceMix How-to" is a practical, hands-on guide that provides you with a number of clear, step-by-step exercises that will help you take advantage of the real power that is behind the leading Apache integration stack.</p> <p>This book guides the reader in how to install ServiceMix and how to get it up and running. It will take you through a number of practical recipes – starting with the basic commands of Apache Karaf container and ending with the deployment of JMS and web service solutions.</p>
Table of Contents (7 chapters)

Listing the available features (Must know)


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.

Getting ready

Before you list the features available for your ServiceMix instance, you must connect to it with the interactive console.

How to do it...

  1. Connect to ServiceMix with the interactive Karaf console.

  2. In the Karaf shell, type the features:list command.

How it works...

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.

There's more...

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.

Filtering results with grep

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.