Learn how to use Mule to build a simple HTTP request-response application.
Screenshot of the main flow from Anypoint Studio
This example application illustrates how to use Mule ESB to build a simple HTTP request-response application. After reading this document, and creating and running the example in Mule, you should be able to leverage what you have learned to create a very simple HTTP request-response application. Also, this example was designed to demonstrate interaction between an end user and Mule via an HTTP request, and Mule's ability to log activity in the application.
In this example, an user calls the Mule application by submitting a request via his browser (i.e. entering a specific URL, http://localhost:8084/echo). The application receives the request and returns the same payload, or "echoes", the response to the end user. In other words, when an user types http://localhost:8084/echo into the address bar of her browser, Mule returns a message in the browser that reads, /echo (see image below, left); if she enters http://localhost:8084/moon, Mule responds with /moon (below, right).
There are two functions the Echo example application illustrates:
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 echo. 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 HTTP Request-Response with Logger application.
|If you understood this example|
|Filtering a Message - Learn how to use filter components to filter an incoming message.||View|
|If you struggled with this example|
|Hello World - The first applications you should get running with Mule.||View|