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 ...

Get Apache Karaf Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.