Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Multicasting (Scatter-Gather) Messages With Mul...

Multicasting (Scatter-Gather) Messages With MuleSoft

Multicasting (Scatter-Gather) Messages With MuleSoft

Avatar for Jitendra Bafna

Jitendra Bafna

May 16, 2017
Tweet

More Decks by Jitendra Bafna

Other Decks in Technology

Transcript

  1. Scatter Gather Multicasting of message with mulesoft can be achieved

    using Scatter Gather which concurrently cast the message to each routes and it collects results from all the routes and aggregates into a single message. During processing of Scatter Gather processing, if any of the routes failed, it doesn't stop sending message to other configured routes, so it is possible that one or more configured routes fails concurrently. By default, if any of the router fails during Scatter Gather processing, the following action will be performed. • Set a exception payload for each failed route. • Throws a CompositeRoutingException.
  2. Scatter Gather CompositeRoutingException extends MessagingException to aggregate exceptions from different

    route in the context of a single message router. Exceptions are correlated to each route through a sequential ID. Scatter Gather application will not start if you have configured with less than two routes. It should always contains two or more routes. Let's walkthrough setting up Scatter Gather with Mule application.
  3. Scatter Gather Setting up HTTP Listener with Mule Flow Now

    first you need to place the HTTP Listener to the source of Mule Flow and configure it. So you can invoke Mule Flow by sending a request over HTTP.
  4. Scatter Gather Configuring Scatter Gather Route With Mule Flow Now

    you need to drop Scatter Gather route in Message Processor of Mule Flow. Now you need to send a message concurrently to multiple routes via HTTP, JMS, Web Service Consumer, File etc. To achieve this we will add different connectors under Scatter Gather route and placing them parallelly and configure all the connectors in Scatter Gather route.
  5. Scatter Gather In previous screenshot, you can see TransformMessage has

    been used after Web Service Consumer and HTTP Requestor. Basically we are getting result back from both endpoints and we are transforming both response to single generic format as response from both route will be in different format. One more transform has been placed at the end of Scatter Gather route, it is because this Transform will aggregates the result from all the routes to single message.
  6. Testing the application You can use the Postman to test

    the application. So we will use HTTP GET method to send request to invoke Mule flow.