Chapter 5. Transformers

Introduction

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 Object-to-String or Object-to-Map 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.

Get Just Spring Integration now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.