Book Image

Apache Karaf Cookbook

By : Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler
Book Image

Apache Karaf Cookbook

By: Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler

Overview of this book

Table of Contents (17 chapters)
Apache Karaf Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a managed service factory implementation of a Camel Router


In this recipe, we'll introduce the power of the OSGi pattern ManagedServiceFactory interface to Apache Camel smart routers. This pattern will allow us to manage multiple service instances, or in our case, Camel routes, via configuration. In fact, we'll produce a new router instance for each configuration we supply our service factory!

Getting ready

The ingredients of this recipe include the Apache Karaf distribution kit, access to JDK, Maven, and a source code editor. The sample code for this recipe is available at https://github.com/jgoodyear/ApacheKarafCookbook/tree/master/chapter2/chapter2-recipe6. Follow the instructions in the Installing Apache Camel modules into Apache Karaf recipe to provide the base requirements to operate the sample code.

How to do it…

This recipe will be somewhat more complex than our previous recipes. It is strongly urged that you follow along with the provided example code:

  1. First, create a Blueprint...