concept transformer in category esb

appears as: A trsformer, The trsformer, trsformers, transformer, trsformers, trsformer, trsformer
Open-Source ESBs in Action: Example Implementations in Mule and ServiceMix

This is an excerpt from Manning's book Open-Source ESBs in Action: Example Implementations in Mule and ServiceMix.

The next concept we discuss is the transformer. As we mentioned earlier, transformers are used to transform data from one format to another. For instance, if you decide to use a common data format for all your ESB message flows, you can use transformers to create the mappings for that format.

Listing 4.4. Mule configuration for the simple logging example with a transformer

With message routing we saw that XPath is an important open standard for implementing routing rules and that XML Schema is an often used open standard for implementing message validation. To include a message transformation step in your integration solution, the XSLT open standard is a common choice. The assumption is that the messages exchanged via the ESB are in XML format. With ServiceMix you’re forced to XML, although you can build transformers to, for example, change a text-based message to an XML format. But the message format inside ServiceMix is, according to the JBI specification, XML. For Mule there is no need to use XML messages inside the bus. We already saw in previous chapters that you can also exchange POJOs over the Mule bus, but the industry is more and more standardizing on XML for exchanging messages because it’s technology and platform independent. So for the topic of message transformation, we’ll assume that the message format is XML.

Table 5.2. Mapping of JMS messages to Java objects

JMS message type

Java object

javax.jms.TextMessage java.lang.String
javax.jms.ObjectMessage java.lang.Object
javax.jms.BytesMessage Byte[] (Note that the transformer will check whether the payload is compressed and automatically uncompress the message.)
javax.jms.MapMessage java.util.Map
javax.jms.StreamMessage java.util.Vector of objects from the stream message