The Message Endpoint EIP encapsulates the messaging system from the rest of the application and customizes a general messaging API for a specific application and task. Therefore, you can change the message API just by changing the endpoint code. This improves the maintainability of applications.
For more information, go to Message Endpoint.
The following sections explain how you can implement a sample scenario of this EIP using the ESB profile of WSO2 EI.
Sample scenario
The example scenario depicts how a stock quote is generated when a request is sent to the ESB profile of WSO2 EI. The sender sends the request to the ESB profile, where the request is then diverted to the Stock Quote service.
Setting up the sample scenario
Follow the below instructions to simulate this sample scenario.
Executing the sample
Send the following request to the ESB Profile using SOAP UI (or any other SOAP client).
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd"> <soapenv:Header/> <soapenv:Body> <ser:getQuote> <ser:request> <xsd:symbol>foo</xsd:symbol> </ser:request> </ser:getQuote> </soapenv:Body> </soapenv:Envelope>
Analysing the output
After sending the request to the ESB profile of WSO2 EI through the client, the Stock Quote service will receive the inventory and log a message. The following output will be printed on the Axis2 server's Console, confirming that the request is successfully received by the back-end service.
You can view the response in the SOAP UI as follows.