Reader small image

You're reading from  Instant Apache Camel Messaging System

Product typeBook
Published inSep 2013
PublisherPackt
ISBN-139781782165347
Edition1st Edition
Concepts
Right arrow
Author (1)
Evgeniy Sharapov
Evgeniy Sharapov
author image
Evgeniy Sharapov

Evgeniy Sharapov has been working in the software development field for over 10 years. At the beginning of his career, he wrote software in C and C++ for signals and data processing; he later picked up Java, Python, Ruby, Clojure, and Scala, gradually moving up on the ladder of abstraction levels. For the last few years he has been developing enterprise level applications on Java platform using all sorts of tools and frameworks, such as Spring, Hibernate, iBatis, Drools, JBoss, Webshere, Maven, and Ant, while maintaining interest in fringe software development using Ruby on Rails, TorqueBox, Clojure, and Scala.
Read more about Evgeniy Sharapov

Right arrow

So, what is Apache Camel?


Apache Camel is an open source integration Java framework that provides a routing and mediation engine API based on its configuration and number of components, which allows a developer to quickly connect various systems consuming or producing data. Apache Camel helps to develop very complex applications by providing re-usable solutions or patterns for solving problems of application integration using message-oriented middleware. These patterns are also called Enterprise Integration Patterns and we briefly describe what they are later in the book.

First, Apache Camel is open source; this means that anyone can try it and see if it meets their needs. For the project manager, this means that there are probably a number of people who know how to work with this framework, so finding a solution or a developer should be easy. For a developer, it means easy access to the source code and the ability to fix things that don't work or get things fixed by someone else who finds the bug first and submits a patch.

Second, Apache Camel, at its core, is comparatively smaller in size than its counterpart and, hence, can be easily explored by going through the source code. For instance, one can easily browse through the existing components just to figure out how to make one's own component.

Third, Apache Camel has a very modular structure. Its core is small, but it comes with a lot of components that range from those working with e-mails to the ones that work as gates to the queues on AS/400 systems. Modularity also allows you to make your own components and weave them effortlessly into the existing infrastructure.

Enterprise Integration Patterns

Enterprise Integration Patterns or EIP are reusable solutions for the organization of communication between applications. At the end of the book, we will provide information about the book that goes by the same title, authored by Gregor Hohpe and Bobby Woolf as well as the website and a community around it.

In short, EIP helps us express the complex interactions between parts of the complex system as a network of subsystems or nodes that communicate by producing and consuming messages. Messages are pieces of data with some meta-information. There's no requirement that a message should be in a particular format, such as XML, or conform to a certain schema, such as SOAP. In this book, we will create an application that will orchestrate communications between systems by routing and transforming these messages.

What Camel can do

Apache Camel, at its core, is the routing and mediation or transformation engine as well as an API for its configuration. Thus, Apache Camel does only a few things—routing messages, creating/transforming messages, and monitoring—but does them very well.

Routing

Routing is an instruction or a list of instructions describing what to do with the message. EIP provides an exhaustive list of all possible routing schemes, including the following to name a few:

  • Filtering: Describes how to get rid of the messages that are not necessary

  • Re-sequencing: Describes how to change the order of the messages based on, for example, the last modified timestamp

  • Splitter: Describes how to split the message, which consists of different elements

  • Aggregator: Describes how to combine several messages into one

There are many others and we will look at most of them later in the book. Apache Camel implements all of them. Further, routing is the primary objective of Apache Camel. The routing strategies can be easily defined using any of the following domain-specific languages (DSL):

  • Java DSL: Using Fluent Interface pattern

  • XML DSL: Routes are written in the XML configuration file

  • Scala DSL: Using Scala programming language

  • Groovy DSL: Using Groovy programming language

  • Annotations DSL: Using runtime annotations as in JSR-175

Transformation

Transformation changes the message passed between the systems based on its content. Examples of the components performing the transformation could be Content Enricher and Content Filter. Content Enricher adds information to the message from an external resource while Content Filter removes information from the message. For example, Content Enricher could add personal information about an employee based on his employee ID, which has been passed in the message, while the Content Filter could do the opposite by stripping the personal information from the message, leaving only the employee ID.

Monitoring

There are several ways to monitor a working Camel application, that is, view and explore the availability of the routes/services, collect performance statistics, and so on; these are Camel Web Console, wiretapping and interception, BrowsableEndpoint, and JMX.

Previous PageNext Page
You have been reading a chapter from
Instant Apache Camel Messaging System
Published in: Sep 2013Publisher: PacktISBN-13: 9781782165347
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Evgeniy Sharapov

Evgeniy Sharapov has been working in the software development field for over 10 years. At the beginning of his career, he wrote software in C and C++ for signals and data processing; he later picked up Java, Python, Ruby, Clojure, and Scala, gradually moving up on the ladder of abstraction levels. For the last few years he has been developing enterprise level applications on Java platform using all sorts of tools and frameworks, such as Spring, Hibernate, iBatis, Drools, JBoss, Webshere, Maven, and Ant, while maintaining interest in fringe software development using Ruby on Rails, TorqueBox, Clojure, and Scala.
Read more about Evgeniy Sharapov