Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-275

Add Scatter-Gather pattern, and make it easy to configure

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Complete
    • 1.0 M4
    • 4.1 RC1
    • Core

    Description

      Scatter-Gather is quite a common and useful pattern. You can implement it in Spring Integration but it's long-winded and wasteful of channel schedules, e.g.

      <integration:handler-endpoint input-channel="requests" handler="splitter"/>
      <integration:handler-endpoint input-channel="splits" handler="router" />
      <integration:handler-endpoint input-channel="scatters" handler="aggregator" />
      <integration:router id="router" ref="scatterer" method="route" />
      <integration:splitter id="splitter" ref="scatterer" method="split" output-channel="splits" />
      <integration:aggregator id="aggregator" ref="scatterer" default-reply-channel="replies" method="aggregate" />

      This example uses a single POJO (called "scatterer") to synthesise a scatter and gather. It first splits the incoming message on "requests" and then routes the resulting messages to a pre-specified set of channels (names injected into the POJO). Then it also acts as an aggregator, waiting for the requests to come back in to the "scatters" channel.

      Attachments

        Issue Links

          Activity

            People

              abilan Artem Bilan
              david_syer Dave Syer
              Votes:
              5 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: