Saturday, October 29, 2016

Call multiple endpoints in parallel using WSO2 ESB

In this blog post I'm going to explain how to call multiple endpoints in parallel using the Clone Mediator.

Synapse Configuration


Explanation

In the above example configuration, we are calling the two endpoints defined in the two call templates in parallel. Similarly by adding multiple "target" elements to the same configuration you can call multiple endpoints in parallel. When using the above configuration same message is cloned and two identical copies of the message is send to the two endpoints.

Note the following.
  • "sequential" attribute is set to false. Hence the two calls are happening in parallel
  • A value is set to "id" so that later we can use this id to aggregate the responses from two services
  • By default "continueParent" is set to false
  • Instead of the call template you can also use a sequence inside the "target"

In a future post I will explain how we can aggregate the response from the two services when the clone mediator is used to call endpoints.

No comments:

Post a Comment