Reliable Message only works with Nhttp configuration.
Objective: Demonstrate the reliable message exchange between the client and ESB using WS-ReliableMessaging (WS-RM).
<definitions xmlns="http://ws.apache.org/ns/synapse"> <proxy name="StockQuoteProxy"> <target> <inSequence> <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> <endpoint> <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> </endpoint> </send> </inSequence> <outSequence> <send/> </outSequence> </target> <publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/> <enableRM/> </proxy> </definitions>
- Deploy the SimpleStockQuoteService in the sample Axis2 server and start it on port 9000.
- Start ESB with the sample configuration number 202 (i.e. wso2esb-samples -sn 202).
In the above configuration, a proxy service is created with WS-RM enabled using the <enableRM/> tag. Therefore, this proxy service is capable of communicating with a WS-RM client. It also removes the WS-RM 1.1 headers in the In Sequence before the message is sent to the back end server. This is required as the reliable messaging is applicable only between the client and ESB. Now start the client with WS-RM as follows:
ant stockquote -Dsymbol=IBM -Dmode=quote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dwsrm11=true
In this case, client sends WS-RM enabled request to ESB where ESB sends normal request to the server. This can be observed by examining the wire level messages between the client and ESB. These messages would be similar to the wire level messages shown in sample 102. Each message would perform a similar function to the messages discussed in sample 53.