Messages deal with data and are the basic structure for moving data over routes. Messages consist of a body (also known as the payload), headers, and attachments (optional). They flow in one direction, from sender to receiver. Each message has a unique ID, generated either by the message creator or by the routing and integration service.
Headers contain metadata, such as sender IDs, content encoding hints, and so on. Attachments can be text, image, audio, or video files, and are typically used with email and web service components.
Message exchanges deal with conversations and can flow in both directions. They encapsulate messages in containers while the messages are in route to their target endpoints. Message exchanges incorporate message exchange patterns (MEPs), which determine the messaging mode.
The consumer endpoint sets the MEP element, which has two options for configuring the messaging mode:
InOnlySpecifies one-way messaging (also known as event messaging). When set, the message exchange contains only an In message, and the caller expects no response. (JMS messaging is often one-way.)
InOutSpecifies request-response messaging. When set, the message exchange contains an In message and an Out message, and the caller expects a response. (HTTP-based transports are often
InOut, where clients request and wait to receive a web page from the server.)
Besides the MEP element, a message exchange consists of several other elements: exchange id (identifies the conversation), exception, and properties. You can inspect and modify these elements while a message is in route to its target endpoint.
For more details, see Understanding Message Formats in Programming EIP Components.
Routing and integration messages differ from JMS messages. For details, see JMS Message Basics.








