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

Making a pure Java-based Camel Router for deployment in Karaf


Developing our first Camel Router for deployment in Karaf doesn't necessarily require using a handful of frameworks and libraries. In this recipe, we'll make a Camel router using pure Java code with just a sprinkling of OSGi and Camel libraries.

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

  1. The first step is creating a Maven-based project. A pom.xml file containing the essential Maven coordinate information and bundle packaging directive will suffice.

  2. The next step is adding Apache Camel and OSGi dependencies to the POM file. We need to add the camel...