7
Scatter Gather Flow Control in Mulesoft

Scatter gather flow control

Embed Size (px)

Citation preview

Page 1: Scatter gather flow control

Scatter Gather Flow Controlin Mulesoft

Page 2: Scatter gather flow control

Scatter-Gather

• The routing message processor Scatter-Gather sends a request message to multiple targets concurrently. It collects the responses from all routes, and aggregates them into a single message.

Page 3: Scatter gather flow control

• Scatter-Gather replaces the All message processor, which is deprecated as of Mule 3.5.0. Note that, unlike All, Scatter-Gather executes routes concurrently instead of sequentially.

• Parallel execution of routes can greatly increase the efficiency of your application and provides more information than sequential processing. Refer to migration details below for more information about the differences you can expect.

Page 4: Scatter gather flow control

• Scatter-Gather Behavior and Exceptions• CompositeRoutingException• Customizing Aggregation Strategies• Configuration• Modeling Scatter-Gather in a Flow• General Tab

Page 5: Scatter gather flow control

• Advanced Tab• Scatter-Gather Threading Profiles• Migrating to Scatter-Gather from the All Message

Router• Why Migrate?• Differences Between Scatter-Gather and the All

Router• Complete Code Example• Serial Multicast with Scatter-Gather

Page 6: Scatter gather flow control

• The Scatter-Gather router sends a message for concurrent processing to all configured routes. The thread executing the flow that owns the router waits until all routes complete or time out.

• If there are no failures, Mule aggregates the results from each of the routes into a message collection (MessageCollection class). Failure in one route does not stop the Scatter-Gather from sending messages to its other configured routes, so it is possible that many, or all routes may fail concurrently.

Page 7: Scatter gather flow control

• By default, if any route fails, Scatter-Gather performs the following actions:

• sets the exception payload accordingly for each route

• throws a CompositeRoutingException, which maps each exception to its corresponding route using a sequential route ID

• Catching the CompositeRoutingException allows you to gather information on all failed routes.