Not all applications understand the data they consume. Sometimes the messages need to be transformed before they can be consumed to achieve a business purpose. For example, a producer uses a Java Object as its payload to produce a message, while a consumer is interested in non-Java Object types like plain XML or name-value pairs.
To help the producer and consumer communicate, transformers are used to transform Java Object to non-Java Objects. The Spring Integration framework provides the transformer components that do exactly what is required. This chapter looks in detail at the transformation endpoints provided by the framework.
First, we will discuss the transformers like
transformers, which come out of the box from the Spring Integration
framework. We then discuss the ways to create our own transformers if the
built-in ones are inadequate.