Service Orchestration and Choice Routing icon

Service Orchestration and Choice Routing

(0 reviews)

home

Illustrates the orchestration of Web service calls and message queue submissions to fulfill an HTTP request for order fulfillment. Routing messages according to the content of their payload, the application coordinates order fulfillment with different vendors and initiates auditing of orders.

Example

This example application simulates a web application for an electronics store. Customers can place purchase orders through a Web interface. The backend application classifies these orders, then processes them according to their classification.

The application acquires the price for each order, sets a status for the order's result (success or failure), then audits the order and amalgamates the results into a summary reply to be sent back to the customer. If the order fails and the purchase price is above $5000, the application initiates the rollback exception strategy.

Set Up and Run the Example

As with the other example templates, you can create fully-functioning applications straight out of the box in Anypoint Studio. You can tweak the configurations of these use case-based examples to create your own customized applications in Mule.

Follow the procedure below to run and test the functionality of this example application in Anypoint Studio.

  1. Create, then run the example application in Anypoint Studio.
  2. Open a web browser, and navigate to the following URL:http://localhost:8091/populate/This causes the application to initialize a local database to store the orders you place. Your browser displays a message that reads: db populated.
  3. In your web browser, navigate to the following URL: http://localhost:8090/orders. Note that sometimes the Ajax server may be delayed for a few seconds while starting up.
  4. Enter order data in the fields, then click Add.
  5. The interface adds your order to the table structure on the right. Click Submit to send your order to the Mule application.
  6. Mule processes the order and returns a response which your browser displays in the Confirmation tab.

The second approach to running this example is using raw SOAP that bypasses the ordering process via the GUI. To achieve this, follow the procedure bellow:

  1. Create, then run the example application in Anypoint Studio.
  2. Open a web browser, then navigate to the following URL:http://localhost:8091/populate/This causes the application to initialize a local database to store the orders you place. Your browser displays a message that reads: db populated.
  3. In your web browser, navigate to the following URL: http://localhost:8090/orders. Click the third tab marked Soap.
  4. Insert the following XML code and click Submit:
  5. The acknowledging response is generated and shown in the right panel.

Notice the purchaseReceipt XML element with the calculated total price.

Documentation

Read full documentation in GitHub


Reviews

TypeExample
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onJun 22, 2017
Asset overview

Asset versions for 1.4.x

Asset versions
VersionActions
1.4.0

Tags