Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Marshalers in ServiceMix are used to convert messages to/from the JBI normalised messages. For example, the JBI spec requires that the payload of a normalized message be XML. So when non-XML messages are sent through a binding component (BC) those messages must be normalized into XML and when a message leave a BC it may need to be denormalized to be compatible with the external service to which it is being sent. For information on this see message normalization. The overall idea with the marshaler is that it captures the raw message as it enters the BC and allows for any kind of transformation of that message before sending it into the JBI component.

Because ServiceMix doesn't provide the ability to handle message normalization for every conceivable message format out there, ServiceMix provides classes for implementing your own custom marshalers.

Existing Marshalers in ServiceMix

The As shown in the image below, the MarshalerSupport class is the base class for creating most custom marshalers. many marshalers inside of ServiceMix:

Image Added

However, there are many other marshalers besides those in the image above. These include the following list but there are many more as well:

servicemix-http

servicemix-jms

servicemix-mail

servicemix-quartz

Writing a Custom Marshaler

...

Older stuff

Questions:

  • My initial questions about this area were based on the apparent ad-hoc implementations of the marshalers (from the class diagram).
  • I thought that the interface Marshaler was intended as a base for all marshalers.
  • I was also confused why some marshalers are standalone, while others derive from a common base (MarshalerSupport).
  • Yet more have interfaces (eg FileMarshaler), but there is no consistency

...