Logo Computer scientist,
engineer, and educator
• Articles • Articles about computing • Articles about software development

Apache open-source integration products from the ground up

apache logo There are a number of open-source projects within the Apache foundation that fall broadly into the category of 'integration products'. These include the Karaf and ServiceMix OSGi runtimes, CXF Web Services framework, and the Camel routing engine, among others. These products are easy to obtain and install, but quite difficult to start developing for; they depend on a set of complex, interconnected technologies described in a very specific vocabulary, and are nearly always used with sophisticated build tools or IDEs.

The Apache integration products are therefore rather hard to start working with, unless you're very familiar with this general area of technology. The need to learn how to use complex and specialized development tools does not improve the situation.

This series of articles is intended to give simple examples of the development of Java applications for the Apache integration products, but without sophisticated tools. Most of the applications presented can be, and in fact have been, developed, built, and deployed using nothing more sophisticated than a command prompt, a text editor, and a Java compiler. My hope is that, by presenting things this way, the detailed operation of the products will become clearer. Some of the later articles do use the Maven build engine, because the number of dependencies is unmanageable using manual methods. However, I have included an article explaining how to use Maven from first principles.

Apache integration software is available from RedHat as part of a supported commercial offering. In general, the articles in this series work on both the 'upstream' and commercial versions; I point out any differences I have spotted.

Although I assume little knowledge of the Apache software, I do assume that the reader is quite familiar with Java, and is comfortable working with a command line (or at least, watching somebody else working at a command line). I also assume some basic familiarity with Web Services, and integration applications in general.

To some extent the articles build on one another, and I would recommend reading them in the order presented.

Like most active open-source projects, the Apache integration software set changes very quickly. In the two years or so that I've been writing these articles Camel, for example, has gone from version 2.10 to version 2.17, ActiveMQ from 5.8 to 5.13, and so on. Since I maintain this stuff in my spare time, I don't have time to review every article for currency, and some things which I claim not to work may now work (or, sadly, vice-versa.
Do please bear this in mind)

Basic principles

Creating OSGI bundles and services from the ground up using Apache Karaf
OSGi is a framework for creating modular, loosley-coupled Java applications that run in a lightweight container. These modules are called bundles in OSGi terminology. The article briefly describes the OSGi model, and explains how to deploy a bundle-based application on Apache Karaf or ServiceMix using only a text editor and command-line tools.

Dynamic configuration of OSGI bundles running on Apache Karaf, from the ground up
This article extends Creating OSGI bundles and services from the ground up using Apache Karaf by adding the ability to configure the bundle at runtime, using the Karaf console. It also adds more sophisticated logging using the log4j API. Because it uses the most of the same code as the previous article, and the same manual build process, I recommend that you don't attempt to follow the steps in this article until you have looked at the previous one.

Creating an Apache Camel route in Java from the ground up
Camel is an integration platform designed to support popular enterprise integration patterns. A camel implementation is based on routes; each route represents a flow of data or messages between various services or applications, perhaps with transformations and decision-making steps. This article describes how to implement a simple route in Java and test it using Camel's built-in runtime engine. Again, we're using nothing more sophisticated than a text editor and command line.

Implementing an Apache Camel route in an OSGi Java bundle from the ground up
Having seen how to create Camel routes and OSGi bundles, this next articles combines the two and demonstrates how to package Java-based Camel routes as OSGi bundles and deploy them on Karaf or ServiceMix.

Web Services from the ground up using Apache CXF
Want to start building Web Services, but don't want to learn a bunch of IDEs or code management tools? This article describes from scratch how to implement a simple Service using CXF, and test it using only a text editor and the command line.

JMS messaging from the ground up using Apache ActiveMQ
Assuming you know a bit about the JMS API, it's easy to write Java applications that interact with the ActiveMQ message broker. This article explains how to get started.

Creating an Apache Camel JMS route in Java from the ground up
This article builds on several of the previous articles, and explains how to configure Apache Camel to consume and process messages from an ActiveMQ message broker.

Creating an Apache Camel JMS route in Java using Maven, step by step
This article demonstrates how to build exactly the same Camel route as described in a previous article, but using Apache Maven to manage the build process and dependencies. It includes a very brief overview of Maven and how to set it up.

Implementing an Apache Camel route in an OSGi Java bundle using Maven from the ground up
Building on previous articles on OSGi, Karaf, Camel, and Maven, this article describes how to implement a simple Camel route using the Blueprint XML format, and deploy it as an OSGi bundle in Karaf.

Specifying a Camel route using Spring XML and the Maven camel runner
Many Camel users prefer to specify their routes using Spring (or, in some contexts, Blueprint) XML. This article describes how do do this, and how to use the Maven Camel runner.

Fabric and clustering

Deploying an OSGi application on Apache Fabric8, from the ground up
Fabric8 (JBoss Fuse 6.1) is a comprehensive integration platform with support for most of the technologies discussed in this series. In this article I describe how to install it in a single-instance configuration, and deploy and manage a simple application.

Using the fabric8 Maven plugin to deploy a Camel route to a fabric
In the previous article I described how to deploy a simple application on fabric8. This article goes further by explaining how to deploy a Camel route defined in XML, using the fabric8 Maven plugin to automate the build and installation process.

Deploying a Camel route on a Fabric8 cluster, step by step
Building on the two previous articles, this article explains how to create a Fabric8 cluster, and deploy a simple Camel route across the cluster.

Deploying a Camel-based application to a Fabric8 cluster hosted on an OpenShift cloud
This article describes how to use Red Hat's public cloud service, OpenShift Online, to host a Fabric8 cluster and deploy a simple Web application.

Testing ActiveMQ master-slave failover on a single machine
Use two instance of ActiveMQ on the same host to experiment with JMS high-availability support.

Web Services

Implementing a Web Service using CXF in an OSGi bundle
How to use the 'code-first' approach to develop Web Services rapidly for an OSGi container such as Fabric8 or Karaf.

Applications of Camel

Using Camel as a filesystem indexing tool
This unusual application of Camel demonstrates the use of directory scanning, JMS messaging, and JDBC database operations in Camel.

Using Camel to automate a Google custom search
Another unusual application of Camel; this one demonstrates REST-based Web Services integration and XML transformation.

Implementing a Web Service using Camel in an OSGi bundle
This article demonstrates how to use Camel to expose a Web Service, and processes client requests using a Camel route. The route is built into an OSGi bundle and deployed on Fabric8 or JBoss Fuse.

Integration with Webshere MQ

Creating and running a Java JMS client for IBM Websphere MQ, from the ground up
Understanding how to configure a JMS connection to WebSphere MQ — a prerequiste for more complex integration scenarios.

Using ActiveMQ with C/C++ applications

Writing a C++ ActiveMQ client from the ground up
This article describes how to build the Apache CMS library from source and use it to support an ActiveMQ client written in C++.

Writing an MQTT client C for ActiveMQ from the ground up
The use of the MQTT protocol is an alternative to the full CMS implementation that is suitable for some applications. This article describes how to use the Mosquitto MQTT library to interact with ActiveMQ with a C program.

Related material

amqutil — a simple test/benchmarking utility for Apache Active MQ.
Copyright © 1994-2015 Kevin Boone. Updated Feb 04 2016