LibraryLink ToToggle FramesPrintFeedback

Message

A message is the smallest unit for transmitting data in a messaging system (represented by the grey dot in the figure below). The message itself might have some internal structure—for example, a message containing multiple parts—which is represented by geometrical figures attached to the grey dot in Figure 2.1.


FUSE Mediation Router defines the following distinct message types:

All of these message types are represented internally by the org.apache.camel.Message interface.

By default, FUSE Mediation Router applies the following structure to all message types:

It is important to remember that this division into headers, body, and attachments is an abstract model of the message. FUSE Mediation Router supports many different components, that generate a wide variety of message formats. Ultimately, it is the underlying component implementation that decides what gets placed into the headers and body of a message.

Internally, FUSE Mediation Router remembers the message IDs, which are used to correlate individual messages. In practice, however, the most important way that FUSE Mediation Router correlates messages is through exchange objects.

An exchange object is an entity that encapsulates related messages, where the collection of related messages is referred to as a message exchange and the rules governing the sequence of messages are referred to as an exchange pattern. For example, two common exchange patterns are: one-way event messages (consisting of an In message), and request-reply exchanges (consisting of an In message, followed by an Out message).

When defining a routing rule in the Java DSL, you can access the headers and body of a message using the following DSL builder methods:

For example, to populate the In message's username header, you can use the following Java DSL route:

from(SourceURL).setHeader("username", "John.Doe").to(TargetURL);