Apache Camel is an open-source integration framework that facilitates connecting systems and exchanging data between them using a route-based model.
In this section, we will present some fundamental concepts for understanding the logic of integrations.
For a deep and complete understanding, consult the official Apache Camel documentation. It offers a detailed view of features, patterns, and best practices.
The diagram below shows an overview of the main concepts that make up the architecture of Camel.

The Camel context acts as the center that manages system integration.
Within the Camel context, the routing engine uses a DSL (Domain-Specific Language) to define and create routes.
Routes connect endpoints, which are entry and exit points for external systems, using different components.
Components provide connectivity and abstraction for various protocols and technologies, such as files, HTTP, JMS, among others.
Messages travel through these routes and are processed by processors, which transform and manipulate data as needed. They perform functions such as message filtering, EIPs, routing, transformation, mediation, enrichment, validation, and interception.
The Camel context is the central core of the Camel application. It is responsible for managing the lifecycle of routes, components, and other resources.

A DSL, or Domain-Specific Language, is a language designed for a specific domain that allows users to define and configure routes and integrations.
Camel supports DSLs in various languages, such as Java, Groovy, YAML, XML, among others. In Sensedia Integrations, we use YAML DSL for building routes.
A route defines the path that a message follows within the integration system, showing the processing steps applied to the message as it travels from a source to a destination.
Generally, a route consists of a series of steps connected in a linear sequence, detailing how the message will be handled, routed, or mediated.
Routes are described using a simple and declarative syntax that makes them easy to read and understand.
See below an example of a Camel route in code format and diagram:

POST requests on the /logs endpoint.{{beforePost}}.POST request to the http://{{supermock}} endpoint, with the parameters:
bridgeEndpoint: true andhttpMethod: POST."afterPost".TIPCheck out a route example.
A message is the minimum unit of data that is propagated and modified throughout a route. It consists of two main components:
Header: metadata associated with the message. Headers can include information such as identifiers, data types, or any other information relevant to message processing.
Body: can be any Java object. Typically it's a string, but can be transformed into more complex objects depending on the integration encoding or components involved.

Exchange is an object that encapsulates the message and some metadata during information exchange between systems. Additionally, it provides utility methods for use in integrations, such as the ability to save and retrieve properties.
Endpoints are components that represent a connection point where data can be sent or received within an integration flow. They define how data is accessed and manipulated in a system.
Endpoints are referenced in the DSL through URIs.
Components are artifacts used in building a route that enable integration and communication between different systems and protocols. They act as connection points between Camel and the various external technologies or services you want to integrate in your routes, such as:
NOTEFor more information about components, access:
EIPs, or Enterprise Integration Patterns, are integration patterns that describe common solutions to frequent problems found in integration systems and communication between applications.
They help structure and optimize communication between applications by providing methods for message routing, data transformation, message aggregation and splitting, message filtering, and error handling. Examples:
TIPAs logic components, EIPs can be compared to the general tools used in Canvas-legacy integrations.
NOTEFor more information about EIPs, access:
An expression language is a way to write instructions in EIPs that help process and manipulate data as they pass through an integration route.
Imagine you're moving data from one place to another, and you need to do something with that data, such as extract information, modify content, or decide where to send it. The expression language allows you to write these instructions in a way that Camel can understand and apply during the data flow.
For example, the condition for a Choice can be written using languages like Groovy, JSONPath, JQ, etc.
NOTEFor more information about expression languages, access:
Data formats are artifacts referenced by data transformation EIPs to determine the input or output format of data. They facilitate data conversion between formats such as XML, JSON, CSV, and others.
NOTEFor more information about data formats, access:
TIP
- Before coding, design your integration flow.
- Define the necessary steps for execution according to business rules.
- Map these steps to the necessary components and/or EIPs.
- Only then code!
We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more