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

Message Construction EIPs


These EIPs are responsible for creating messages in response to other messages.

The Event Message EIP

The Event Message EIP describes how to use messaging to transmit events from one application to another.

Camel supports this EIP by the use of the Message Exchange Pattern in the exchange. When defined as InOnly, it means that we deal with a one way event message.

So, basically, the Event Message EIP means one directional messages.

The first endpoint of the route defines the expected Exchange pattern, but, at any point in the route, you can force the Exchange pattern to InOnly to make it act as an Event Message EIP.

For this, you have to use the inOnly notation:

<route>
   <from uri="direct:start"/>
   <inOnly uri="bean:myBean"/>
</route>

You can also use the setExchangePattern notation:

<route>
   <from uri="direct:start"/>
   <setExchangePattern pattern="InOnly"/>
   <to uri="bean:myBean"/>
</route>

It's also possible...