Search code examples
web-servicesrestmuleesbanypoint-studio

Mule ESB Consume Multiple REST Services


My API name is A, and I have to call 2 REST services in my API.

I was able to call one REST service, and tried calling 2nd REST service using Scatter-Gather but no luck.

Here is my flow diagram for calling single REST service enter image description here

Based on service response, I am using Choice and transforming message to my Service schema and things are cool up to this point, but I have few fields left in my schema, those need to fetched from other REST call. So.., How can i consume two REST services and transform them into my API schema?

enter image description here

I have tried with scatter-gather, first call POST and second call is GET and I was able to map some details from first and some details from second REST call to my API schema, but How can I display my final output ?

Thanks


Solution

  • You can do this by using Variable transformers to store the results of the calls. I was able to achieve something similar using the following: Image

    Note the use of sub-flows, each of which start with an HTTP Request Connector.

    I'd be happy to clarify anything here if needed, just let me know!