Book Image

Mastering Apache Camel

By : Bilgin Ismet Ibryam, Jean Baptiste Onofre, Jean-Baptiste Onofré
5 (1)
Book Image

Mastering Apache Camel

5 (1)
By: Bilgin Ismet Ibryam, Jean Baptiste Onofre, Jean-Baptiste Onofré

Overview of this book

Table of Contents (15 chapters)
Mastering Apache Camel
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

What is a processor?


A consumer endpoint receives an event from the environment and wraps it as an Exchange.

The routing engine transports this Exchange from the endpoint to a processor, which is possible from one processor to another processor, up to a final endpoint via a Channel. The route can end at a processor returning the Exchange to the consumer endpoint if the MEP is InOut (and using the out message), or stop with a producer endpoint, sending the message to the environment.

This means that a processor acts as an Exchange modifier—it consumes an Exchange, and eventually updates it. We can see the processor as a message translator. Actually, all Camel Exchange Integration Patterns (EIPs) are implemented using processors.

A processor is described by the org.apache.camel.Processor interface. This interface provides only one method:

void process(Exchange exchange) throws Exception(Exchange exchange) throws Exception

As the processor directly receives an Exchange, it has access to all the...