Using getIn or getOut methods on Exchange
The Camel API is influenced by the JBI specification which defines a concept called Message Exchange Patterns (MEP for short). The MEP defines the messaging style used such as one-way (InOnly) or request-reply (InOut).
The Exchange API provides two methods to get a message, either
Important for Camel end users
As a Camel end user you should always prefer to use the
getIn method, and frankly just forget about the
If you use the
getOut method, then data from the in message would be lost. For example several Camel end users who got started with Camel, couldn't understand why their message headers was lost during route in Camel. The problem was they used
getOut method in a Camel Processor. They should as said use the
If you decide to use the
getOut method and want to keep headers, attachments and the likes, then you must manually copy those information from the in to the out message.