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)

Installing a new feature (Must know)


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.

Getting ready

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.

How to do it...

  1. Connect to your container using the interactive ServiceMix console.

  2. In the ServiceMix console, type the feature:install featureName command

How it works...

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.

There's more...

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.

Karaf tab completion

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.