Home » Java » What exactly is Apache Camel?

What exactly is Apache Camel?

Posted by: admin November 2, 2017 Leave a comment


I don’t understand what exactly Camel does.

If you could give in 101 words an introduction to Camel:

  • What exactly is it?
  • How does it interact with an application written in Java?
  • Is it something that goes together with the server?
  • Is it an independent program?

Please explain what Camel is.


If you have 5 to 10 minutes, I generally recommend people to read this Integration with Apache Camel by Jonathan Anstey. It’s a well written piece which gives a brief introduction to and overview of some of Camel’s concepts, and it implements a use case with code samples. In it, Jonathan writes:

Apache Camel is an open source Java framework that focuses on making integration easier and more accessible to developers. It does this by providing:

  • concrete implementations of all the widely used Enterprise Integration Patterns (EIPs)
  • connectivity to a great variety of transports and APIs
  • easy to use Domain Specific Languages (DSLs) to wire EIPs and transports together

There is also a free chapter of Camel in Action which introduces Camel in the first chapter. Jonathan is a co-author on that book with me.


My take to describe this in a more accessible way…

In order to understand what Apache Camel is, you need to understand what Enterprise Integration Patterns are.

Let’s start with what we presumably already know: The Singleton pattern, the Factory pattern, etc; They are merely ways of organizing your solution to the problem, but they are not solutions themselves. These patterns were analyzed and extracted for the rest of us by the Gang of Four, when they published their book: Design Patterns. They saved some of us tremendous effort in thinking of how to best structure our code.

Much like the Gang of Four, Gregor Hohpe and Bobby Woolf authored the book Enterprise Integration Patterns (EIP) in which they propose and document a set of new patterns and blueprints for how we could best design large component-based systems, where components can be running on the same process or in a different machine.

They basically propose that we structure our system to be message oriented — where components communicate with each others using messages as inputs and outputs and absolutely nothing else. They show us a complete set of patterns that we may choose from and implement in our different components that will together form the whole system.

So what is Apache Camel?

Apache Camel offers you the interfaces for the EIPs, the base objects, commonly needed implementations, debugging tools, a configuration system, and many other helpers which will save you a ton of time when you want to implement your solution to follow the EIPs.

Take MVC. MVC is pretty simple in theory and we could implement it without any framework help. But good MVC frameworks provide us with the structure ready-to-use and have gone the extra mile and thought out all the other “side” things you need when you create a large MVC project and that’s why we use them most of the time.

That’s exactly what Apache Camel is for EIPs. It’s a complete production-ready framework for people who want to implement their solution to follow the EIPs.


Creating a project description should not be complicated.

I say:

Apache Camel is messaging technology glue with routing. It joins together messaging start and end points allowing the transference of messages from different sources to different destinations. For example: JMS -> JSON, HTTP -> JMS or funneling FTP -> JMS, HTTP -> JMS, JSON -> JMS

Wikipedia says:

Apache Camel is a rule-based routing and mediation engine which provides a Java object based implementation of the Enterprise Integration Patterns using an API (or declarative Java Domain Specific Language) to configure routing and mediation rules. The domain specific language means that Apache Camel can support type-safe smart completion of routing rules in your IDE using regular Java code without huge amounts of XML configuration files; though XML configuration inside Spring is also supported.

See? That wasn’t hard was it?


In short:

When there is a requirement to connect / integrate systems, you will probably need to connect to some data source and then process this data to match your business requirements.

In order to do that:

1) You could develop custom program that would do it (might be time consuming and hard to understand, maintain for other developer)

2) Alternatively, you could use Apache Camel to do it in standardised way (it has most of the connectors already developed for you, you just need to set it up and plug your logic – called Process):

Camel will help you to:

  1. Consume data from any source/format
  2. Process this data
  3. Output data to any source/format

By using Apache Camel you will make it easy to understand / maintain / extend your system to another developer.

Apache Camel is developed with Enterprise Integration Patterns. The patterns help you to integrate systems in a good way 🙂


A diagram is better than thousands of description.
This Diagram illustrates the architecture of Camel.

enter image description here


One of the things you need to understand, before you try to understand Apache Camel, are Enterprise Integration Patterns. Not everyone in the field is actually aware of them. While you can certainly read the Enterprise Integration Patterns book, a quicker way to get up to speed on them would be to read something like the Wikipedia article on Enterprise Application Integration.

One you have read and understood the subject area, you would be much more likely to understand the purpose of Apache Camel




Camel based routing can be understood much easily by putting yourself in the shoes of a Airline owner (eg.: American Airlines, Jet Airways) .

Purpose of ‘your airline’ is to ‘carry’ ‘passengers’ from one ‘city’ to another one in the world. You use aircrafts from different ‘aircraft companies’ like Boeing, Airbus, HAL for carrying passengers.

Your airline’s boards passengers using ‘airports’ of the from city and deboards them using the airport of the to city. A passenger may ‘travel’ to multiple cities, but everywhere they have to go through the airport to travel between your airline’s aircraft and the city.

Note that a passenger ‘departing’ from the city is essentially ‘arriving’ into your airlines’ aircraft. And a passeger ‘arriving’ into the city, is essentially departing from the aircraft. Since we are in the shoes of airline owner, the term ‘arrival passenger’ and ‘departing passenger’ are reversed from our conventional notions which are based on cities perspective.

Same ‘airport’ infrastructure of each city is used by ‘departing’ passengers and ‘arrival’ passengers. An airport provides ‘departing infrastructure’ for departing passengers, which is different from the ‘arrival infrastructure’ provided for arriving passengers.

Passengers can continue doing their day to their activities due to various ‘amenities’ provided inside the aircraft by your airlines, while travelling.

On top of that, your airline also provides lounge facilities for special treatments like ‘understanding local language’ and or preparing you for the ‘travel’.

Lets replace few words/phrases used above with following:

your airline: Apache Camel

aircraft companies: Transport mechanisms

your airline’s aircraft: Apache Camel’s underlying transport mechanism

carry: route

passengers: message;

city: system;

airport: Camel Component;

understanding local languages: Type Conversions;

departing: producing, produced

arriving: consuming, consumed

travel: routed

amenities: provided

After replacing the words, here is what you get:

Purpose of ‘Apache Camel’ is to route ‘messages’ from one ‘system’ to another one in the world. Apache camel uses different transport mechanisms for message routing.

Apache Camel picks up messages using ‘Camel based Component’ of the ‘from’ system and drops them using the ‘Camel based Component’ of the ‘to’ system. A message may route to multiple systems, but everywhere they have to go through ‘Camel based Components’ to travel between ‘Apache Camel’s underlying transport mechanism’ and the system.

Note that a message ‘produced’ from the system is essentially ‘consumed’ into Apache Camel’s underlying transport mechanism’. And a message consumed by a system, is essentially produced by the ‘Apache Camel’s underlying transport mechanism’.

Since we are attempting to understand Camel, we must think from Camel’s perspective here onwards. The meaning of the terms ‘consumer message’ and ‘producer message’ are ,thus, reversed from our conventional notions which are based on a system’s perspective.

Same ‘Camel based Component’s ‘ coding infrastructure is used by ‘producer message’ and ‘consumer message’. A ‘Camel based Component’ provides a ‘producer endpoint’ for ‘producer message’ and a ‘consumer endpoint’ for ‘consumer message’.

Messages can be processed by Camel when they are being routed.

On top of this routing, Camel provides special features like ‘Type Conversion’ and many more…


If you are aware of Enterprise Integration Patterns, Apache Camel is one integration framework which implements all EIPs.

And you can deploy Camel as a standalone application in a web-container.

Basically, if you have to integrate several applications with different protocols and technologies, you can use Camel.


A definition from another perspective:

Apache Camel is an integration framework. It consists of some Java libraries, which helps you implementing integration problems on the Java platform. What this means and how it differs from APIs on the one side and an Enterprise Service Bus (ESB) on the other side is described in my article “When to use Apache Camel“.


Camel sends messages from A to B:

enter image description here

Why a whole framework for this? Well, what if you have:

  • many senders and many receivers
  • a dozen of protocols (ftp, http, jms, etc.)
  • many complex rules
    • Send a message A to Receivers A and B only
    • Send a message B to Receiver C as XML, but partly translate it, enrich it (add metadata) and IF condition X, then send it to Receiver D too, but as CSV.

So now you need:

  • translate between protocols
  • glue components together
  • define routes – what goes where
  • filter some things in some cases

Camel gives you the above (and more) out of the box:

enter image description here

with a cool DSL language for you to define the what and how:

  new DefaultCamelContext().addRoutes(new RouteBuilder() {
        public void configure() {
                    .choice() // start router rules

See also this and this and Camel in Action (as others have said, an excellent book!)


What exactly is it?

Apache Camel is a lightweight integration framework which implements all Enterprise Integration patterns.You can easily integrate different applications using the required patterns.

You can use Java, Spring XML, Scala or Groovy. Almost every technology you can imagine is available, for example HTTP, FTP, JMS, EJB, JPA, RMI, JMS, JMX, LDAP, Netty etc.

Have a look at this article and EIP pattern article

How does it interact with an application written in Java?

Camel uses a Java Domain Specific Language or DSL for creating Enterprise Integration Patterns or Routes in a variety of domain-specific languages (DSL) as listed below.

Java DSL – A Java based DSL using the fluent builder style.

The story of Enterprise Integration Pattern resolves around these concepts :

Message, End Point, Producer, Consumer, Routing, Bus, Transform and Process.

Have a look at this article By Anirban Konar for one of real time use cases.

Is it something that goes together with the server?

It acts as a bridge across multiple enterprise sub systems.

Is it an independent program?

Apache Camel, an integration framework, integrates different independent applications.

The major advantage of Camel : You can integrate different applications with different technologies (and different protocols) by using same same concepts for every integration.


Most “new” things in computing aren’t really new at all, they’re just a mystifying wrapper around something that already well-understood. When they’re hard to understand, it’s usually because someone decided to invent new language terms or colonise existing terms for a different purpose (a good example of that is the X developers’ reversal of what “client” and “server” mean.)

Camel is a Java-based wrapper/API for inter-application middleware.

Middleware is a general term for software that provides interpretation services between entities that don’t share a common language or data types.

That’s what Camel is, at bottom. We can flesh out the description by noting that it provides for EIP-type middleware.

It doesn’t provide the middleware itself, since it can’t know the details of what the applications need to communicate. But it provides the API for creating the invariant parts of that middleware (create a start point, create an end point, create conditions for starting and ending, etc)

Hope that helps.


Here is another attempt at it.

You know how there are/were things like Webmethods, ICAN Seebeyond, Tibco BW, IBM Broker. They all did help with integration solutions in the enterprise. These tools are commonly known by the name Enterprise Application Integration (EAI) tools.

There were mostly drag drop tools built around these technologies and in parts you would have to write adapters in Java. These adapter code were either untested or had poor tooling/automation around testing.

Just like with design patterns in programming, you have Enterprise Integration patterns for common integration solutions. They were made famous by a book of the same name by Gregor Hohpe and Bobby Woolf.

Although it is quite possible to implement integration solutions which use one or many EIP, Camel is an attempt at doing this within your code base using one of XML, Java, Groovy or Scala.

Camel supports all Enterprise Integration Patterns listed in the book via its rich DSL and routing mechanism.

So Camel is a competing technoloy to other EAI tools with better support for testing your integration code. The code is concise because of the Domain Specific Languages (DSLs). It is readable by even business users and it is free and makes you productive.


There are lot of frameworks that facilitates us for messaging and solving problems in messaging. One such product is Apache Camel.

Most of the common problems have proven solutions called as design patterns. The design pattern for messaging is Enterprise Integration patterns(EIPs) which are well explained here. Apache camel help us to implement our solution using the EIPs.

The strength of an integration framework is its ability to facilitate us through EIPs or other patterns,number of transports and components and ease of development on which Apache camel stands on the top of the list

Each of the Frameworks has its own advantages Some of the special features of Apache camel are the following.

  1. It provides the coding to be in many DSLs namely Java DSL and Spring xml based DSL , which are popular.
  2. Easy use and simple to use.
  3. Fuse IDE is a product that helps you to code through UI

Camel helps in routing, transformation, monitoring.

It uses Routes; which can be described as :

When service bus receives particular message, it will route it through no of services/broker destinations such as queue/topics. This path is known as route.

your stock application has got some input by analyst, it will be processed through the application/web component and then result will be published to all the interested/registered members for particular stock update.


Yes, this is probably a bit late. But one thing to add to everyone else’s comments is that, Camel is actually a toolbox rather than a complete set of features. You should bear this in mind when developing and need to do various transformations and protocol conversions.

Camel itself relies on other frameworks and therefore sometimes you need to understand those as well in order to understand which is best suited for your needs. There are for example multiple ways to handle REST. This can get a bit confusing at first, but once you starting using and testing you will feel at ease and your knowledge of the different concepts will increase.


In plain English, camel gets (many) things done without much of boiler plate code.

Just to give you a perspective, the Java DSL given below will create a REST endpoint which will be able to accept an XML consisting of List of Products and splits it into multiple products and invoke Process method of BrandProcessor with it.
And just by adding .parallelProcessing (note the commented out part) it will parallel process all the Product Objects. (Product class is JAXB/XJC generated Java stub from the XSD which the input xml is confined to.) This much code (along with few Camel dependencies) will get the job done which used to take 100s of lines of Java code.


After adding the route ID and logging statement

.log(LoggingLevel.INFO, "Item Delta received on Item-DeltaRESTRoute")

This is just a sample, Camel is much more than just REST end point. Just take a look the pluggable component list http://camel.apache.org/components.html


In an enterprise, a number of systems of different types exist. Some of these may be legacy systems while some may be new. These systems often interact with each other,and need to be integrated. This interaction or integration is not easy as the implementations of the systems, their message formats may differ. One way to achieve this is to implement code which bridges these differences. However this will be point to point integration. If tomorrow again if there is change in a system the other might also have to be changed which is not good. Instead of this point to point integration which causes tight coupling we can implement an additional layer to mediate the differences between the systems. This results in loose coupling and not affect much our existing systems. Apache Camel is a rule-based routing and mediation engine that provides a Java object-based implementation of the Enterprise Integration Patterns using an API (or declarative Java Domain Specific Language) to configure routing and mediation rules.

Detailed Explanation and examples can be found here Apache Camel Tutorials


Its like a pipeline connecting


In between u can add as many channels and pipes. The faucet can be of any type
automatic or manual for flow of data and a route to channelize the flow.

It supports and have implementation for all types and kinds of processing.
And for same processing many approaches because it has many components and each component can also provide the desired output using different methods under it.

For instance,
File transfer can be done in camel with types file moved or copied and also from folder, server or queue.

   - from-->process-->to
   - from-->bean-->to
   - from-->process-->bean-->to

From/to—-folder, direct, seda, vm can be anything