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 aggregator


The aggregator is for showcasing the aggregator usage. An aggregator is plugged on the output channel of the filter, that is, fetchedFeedChannelForAggregatior. We will use all the three components of aggregator: correlation, completion, and aggregator. Let's declare the beans:

  <bean id="soFeedCorrelationStrategyBean" class="com.cpandey.siexample.aggregator.CorrelationStrategy"/>

  <bean id="sofeedCompletionStrategyBean" class="com.cpandey.siexample.aggregator.CompletionStrategy"/>

  <bean id="aggregatorSoFeedBean" class="com.cpandey.siexample.aggregator.SoFeedAggregator"/>

Once we have defined the three vital components of an aggregator, let's define the component, which will aggregate feeds in a group of five and then release only on the next channel:

  <int:aggregator input-channel="fetchedFeedChannelForAggregatior"
    output-channel="aggregatedFeedChannel" ref="aggregatorSoFeedBean"
    method="aggregateAndPublish" release-strategy="sofeedCompletionStrategyBean...