Anypoint Exchange

Home to the complete listing of connectors, templates, examples and APIs.
Discover and use proven assets built by the MuleSoft ecosystem, or add assets to a private
tenant of Anypoint Exchange for collaboration and sharing of internal best practices.

Learn more
Sign up
Aggregate API Invocation

Aggregate API Invocation

โ˜…
โ˜…
โ˜…
โ˜…
โ˜…
(0 reviews)

Illustrates how to aggregate responses from multiple APIs into a single response. It is complementary to the developer blog series that gives step by step instructions to build out this example.

Assumptions

This document describes the details of the example within the context of Anypointโ„ข Studio, Mule ESBโ€™s graphical user interface (GUI). Where appropriate, the XML configuration accompanies the Studio interface screenshots. This document assumes that you are familiar with Mule ESB, the Anypoint Studio interface.

Example

In this use case we receive a customerId query parameter as an input. We will use this value to invoke two APIs. One to fetch customer details and the other to fetch account details.These APIs can be REST service or SOAP based web services. Once the APIs are invoked the response from both are aggregated and mapped to the final response message.

We will use scatter gather design pattern to invoke multiple APIs in parallel. Once all the responses are collected, we finally map it to the output.

Set Up and Run the Example

  1. In this example we invoke two APIs, Customer REST API and Expose a Database through a SOAP Web Service. We have covered in out previous blog posts on how to create these services. Check out the links, HowTo โ€“ Build a REST API with XML payload and HowTo โ€“ Wrap SOAP web service around a database

  2. To run this example, download the Mule project from Exchange and deploy it to Mule iPass.

  3. After running the services open the Example project in Anypoint Studio from Anypoint Exchange.

  4. Open src/main/app/mule-app.properties and add the properties for the two services.

  5. Run the example application in Anypoint Studio or Standalone

  6. If you are running the project in Anypoint Studio then test it using the APIkit Console that pops up after running the project. If you are following the sample projects then try customerid = 1.


Reviews

Download
Log into Anypoint Platform to download this asset

Overview

Type
Example
Created by
MO
MuleSoft Organization
Published onJun 22, 2017

Versions

VersionRuntime version
1.0.03.x