This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Message Exchange between ESB and Server (1.1)
Objective: Demonstrate the message exchange between ESB and the back-end server using WS-ReliableMessaging 1.1 Specification (WS-RM). This sample is similar to sample Message Exchange between ESB and Server except it uses the RM 1.1 for the communication.
Prerequisites:
- Deploy the
ReliableStockQuoteService
in the sample Axis2 server by switching to thesamples/axis2Server/src/ReliableStockQuoteService
directory and running ant. - Start the sample Axis2 server on port 9000.
- Start ESB with the sample configuration 102 (i.e.
wso2esb-samples -sn 102
).
<definitions xmlns="http://ws.apache.org/ns/synapse"> <in> <RMSequence single="true" version="1.1"/> <send> <endpoint name="reliable"> <address uri="http://localhost:9000/services/ReliableStockQuoteService"> <enableRM/> <enableAddressing/> </address> </endpoint> </send> </in> <out> <header name="wsrm:SequenceAcknowledgement" action="remove" xmlns:wsrm="http://docs.oasis-open.org/ws-rx/wsrm/200702"/> <header name="wsrm:Sequence" action="remove" xmlns:wsrm="http://docs.oasis-open.org/ws-rx/wsrm/200702"/> <header name="wsrm:AckRequested" action="remove" xmlns:wsrm="http://docs.oasis-open.org/ws-rx/wsrm/200702"/> <send/> </out> </definitions>
In the above configuration, WS-RM is engaged to the endpoint using the <enableRM/
> element. It is possible to engage WS-RM to both Address and WSDL endpoints using this tag. In addition to the RM enabled endpoint, RMSequence Mediator is specified before the Send Mediator. This mediator is used to specify the set of messages to be sent using a single RM sequence. Also it specifies the RM version. In this sample, it is specified as single message per sequence. It also specifies the version of the WS-RM to be used. RM related SOAP headers are removed from the message in the Out mediator as WS-RM message exchange happens only between the ESB and the server.
Run the sample client using the following command.
ant stockquote -Dsymbol=IBM -Dmode=quote -Daddurl=http://localhost:8280
You can observe the client output displaying the quote price for IBM as follows:
[java] Standard :: Stock price = $189.2521262517493
You can observer the set of messages exchanged between ESB and back end service using a tool like TCPMon.