Chaining handlers

We have discussed quite a lot of handlers provided by Spring Integration as filters, transformers, service activators, and so on, which can be independently applied on to the message—Spring Integration further provides a mechanism to chain these handlers. A special implementation of MessageHandler is MessageHandlerChain, can be configured as a single message endpoint. It is a chain of other handlers, and a message received simply delegates it to the configured handlers in a predefined sequence. Let's take an example:

<int:chain input-channel="cahinedInputFeedChannel" output-channel="logChannel"> input-channel="cahinedInputFeedChannel" output-channel="logChannel"> <int:filter ref="filterSoFeedBean" method="filterFeed" throw-exception-on-rejection="true"/> ...

Get Spring Integration Essentials 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.