Book Image

Spring Integration Essentials

By : CHANDAN K PANDEY
Book Image

Spring Integration Essentials

By: CHANDAN K PANDEY

Overview of this book

Table of Contents (18 chapters)
Spring Integration Essentials
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

The splitter


The aggregator will aggregate the message and put it on the aggregatedFeedChannel. Let's have a splitter wired on this channel, which can split back the list of messages and pass one at a time for further processing on to the splittedFeedChannel channel. The Spring configuration is given in the following code snippet:

<int:splitter ref="splitterSoFeedBean" method="splitAndPublish" input-channel="aggregatedFeedChannel" output-channel="splittedFeedChannel" />

The JavaBean with the splitter logic:

import java.util.List;
import com.sun.syndication.feed.synd.SyndEntry;
public class SoFeedSplitter {
  public List<SyndEntry> splitAndPublish(List<SyndEntry> message) {
    //Return one message from list at a time -this will be picked up //by the processor
    return message;
  }
}