Scatter and gather in mule
-
Upload
rajkattamuri -
Category
Technology
-
view
258 -
download
0
Transcript of Scatter and gather in mule
![Page 1: Scatter and gather in mule](https://reader036.fdocuments.in/reader036/viewer/2022072118/586fdcf31a28ab18428b66bf/html5/thumbnails/1.jpg)
Scatter-Gather in Mule
![Page 2: Scatter and gather in mule](https://reader036.fdocuments.in/reader036/viewer/2022072118/586fdcf31a28ab18428b66bf/html5/thumbnails/2.jpg)
Scatter-Gather is an important component in Mule that sends a request message to multiple targets concurrently. At the end it collects the responses from all routes, and aggregates them into a single message.
![Page 3: Scatter and gather in mule](https://reader036.fdocuments.in/reader036/viewer/2022072118/586fdcf31a28ab18428b66bf/html5/thumbnails/3.jpg)
Message Processor
Message Processor
Combined Payload
Processing concurrently
![Page 4: Scatter and gather in mule](https://reader036.fdocuments.in/reader036/viewer/2022072118/586fdcf31a28ab18428b66bf/html5/thumbnails/4.jpg)
How to use Scatter-Gather in Mule ??
![Page 5: Scatter and gather in mule](https://reader036.fdocuments.in/reader036/viewer/2022072118/586fdcf31a28ab18428b66bf/html5/thumbnails/5.jpg)
To implement scatter-gather in Mule lets consider the following flow:-
You can see that there is two flow reference after scatter-gather which means it will process 2 flows concurrently .
![Page 6: Scatter and gather in mule](https://reader036.fdocuments.in/reader036/viewer/2022072118/586fdcf31a28ab18428b66bf/html5/thumbnails/6.jpg)
The other 2 sub flows are here:-
Now, You will see that these two flows will run concurrently and at the end the payloads from both the flow will be merged .
![Page 7: Scatter and gather in mule](https://reader036.fdocuments.in/reader036/viewer/2022072118/586fdcf31a28ab18428b66bf/html5/thumbnails/7.jpg)
Our Mule config will be as follow:-
![Page 8: Scatter and gather in mule](https://reader036.fdocuments.in/reader036/viewer/2022072118/586fdcf31a28ab18428b66bf/html5/thumbnails/8.jpg)
Now, our flow is ready .. If we can test our flow using the url :- http://localhost:8090/scattergather and we will get in logs as follows :-
You can see both the flow ended up concurrently and scatter-gather has merged the payload fro both the flows at the end
![Page 9: Scatter and gather in mule](https://reader036.fdocuments.in/reader036/viewer/2022072118/586fdcf31a28ab18428b66bf/html5/thumbnails/9.jpg)
In my next slide I will bring some other techniques in Mule implementation .Hope you have enjoyed this simpler version. Keep sharing your knowledge and let our Mule community grow
![Page 10: Scatter and gather in mule](https://reader036.fdocuments.in/reader036/viewer/2022072118/586fdcf31a28ab18428b66bf/html5/thumbnails/10.jpg)
Thank You