Illustrates how to use Mule 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 demonstrates the 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 (such as, 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 a user types
http://localhost:8084/echo into the address bar of a browser, Mule returns a message in the browser that reads, /echo (see image below, left); if the user 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.
http://localhost:8084/echoin the address bar, then press Enter.
|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|