home

Understand the power of content-based routing in Web service integrations.


Screenshot of the main flow in Anypoint Studio, view full image here

Description

This Mule ESB example application demonstrates the power of content-based routing in Web service integrations.

This application minimizes a borrower’s work in acquiring the best interest rate for a loan. This example should help you to make informed decisions about using the four elements in your Mule applications listed below.

Example Use Case

This example application exposes a Web service that processes end user requests for interest rate quotes from banks. From a Web browser, an end user submits a request which contains the following:

  • borrower’s name
  • amount of the loan
  • repayment term of the loan
  • borrower’s social security number (SSN)

The application accesses other Web services to process the request, then responds to the end user. The response identifies the bank name and interest rate of the lowest quote.

The Web service uses five elements to maximize its processing efficiency:

  • Choice Flow Controls to route messages based on content
  • Transformers to convert message payloads’ data format
  • Message Enrichers to add to, rather than change, message payloads
  • Foreach to iteratively, and synchronously, process message payloads
  • Dynamic connectors to send requests to different banks depending on the message payload

Set Up and Run the Example

As with other example templates you can create template applications straight out of the box in Anypoint Studio or, in this case, also in Mule Standalone where this example is called loanbroker-simple. You can tweak the configurations of these use case-based examples to create your own customized applications in Mule.

Follow the procedure below to create, then run the Loan Broker application in Mule ESB.

  1. Create, then run the example application in Anypoint Studio or Standalone Mule.
  2. Open your Web browser.
  3. Type http://localhost:11081/?name=Muley&amount=20000&term=48&ssn=1234 into the address bar of your browser, then press enter to elicit a response from the application.
  4. In your browser’s address bar, replace the amount value with 5000, then press enter to elicit a new response from the application.

Documentation

Read full documentation in GitHub