Skip to content
illyfrancis edited this page Sep 9, 2013 · 12 revisions

Basic info

Overview

Camel is composed of:

  • processors
  • components
  • routes

All these are contained within the CamelContext

CamelContext

One of the services that CamelContext provides is Registry which allows you to look up beans. Default will be a JNDI registry but using Camel from Spring, this will be the Spring ApplicationContext.

Can the registry be based on Guice?

Routes

Each route in Camel has a unique identifier (used for logging, debugging, monitoring and starting and stopping routes). Routes have exactly one input source for messages, effectively tied to an input endpoint.

Processors

Handle things in between endpoints like

  • EIPs
  • Routing
  • Transformation
  • Mediation
  • Enrichment
  • Validation
  • Interception

Component

Associated with a name that's used in a URI and they act as a factory of endpoints.

E.g. a FileComponent is referred to by file in a URI, and it creates FileEndpoints.

Endpoint

An endpoint is the Camel abstraction that models the end of a channel through which a system can send or receive messages.

In Camel, you configure endpoints using URIs, such as file:data/inbox?delay=5000, and also refer to endpoints the same way.

Message model

Two abstractions:

  1. Message (org.apache.camel.Message)
  2. Exchange ('org.apache.camel.Exchange')

Message

Three parts:

  • Headers
  • Attachments
  • Body

During routing, messages are contained in an exchange

Exchange

An exchange in Camel is the message's container during routing. An exchange also provides support for the various types of interactions between systems, aka message exchange patterns (MEPs). MEPs are used to differentiate between one-way and request-response messaging styles.

  • InOnly - a one-way message (aka an Event message)
  • InOut - a request-response message

A Camel exchange has:

  • ID (exchange ID)
  • MEP
  • Exception
  • Properties - similar to message headers, but they last for the duration of the entire exchange. (read up a bit more)
  • In message - input message, the in message contains the request message
  • Out message - optional message that only exists if the MEP is InOut. The out message contains the reply message

Clone this wiki locally