8.5.13

Why and How with Message Handler Chain in Spring Integration?

5.6 Message Handler Chain <int:chain/> is not a pattern in EIP. It is a convenient usage in Spring Integration to make the configuration simpler.

The MessageHandlerChain is an implementation of MessageHandler that can be configured as a single Message Endpoint while actually delegating to a chain of other handlers, such as Filters, Transformers, Splitters, and so on. This can lead to a much simpler configuration when several handlers need to be connected in a fixed, linear progression. For example, it is fairly common to provide a Transformer before other components. Similarly, when providing a Filter before some other component in a chain, you are essentially creating a Selective Consumer. In either case, the chain only requires a single input-channel and a single output-channel eliminating the need to define channels for each individual component.

This is a good one to explain Message Handler Chain with an example.

java - Spring integration Message handler chain usage? - Stack Overflow

No comments: