Asynchronous Request/Response Reliable Communication  Locate

Overview  Locate

This demo shows the use of WS-ReliableMessaging for asynchronous reliable request/response communication.

See overview at one-way demo.

The service shows how to correlate a request sequence to the response one. The correlation means that request and response sequences will have the same length. It is also possible to send reliable responses using one-length sequences (see a comment in the service class).

[Note]Note

In the current version of SESJ it is not possible to create a persistent "AsynchronousConversation" when using asynchronous invocation. It is not possible to retrieve undelivered responses after SESJ restart. You can use synchronous (blocking) or two one-way invocations for now.

Demo Package Description  Locate

In addition to the files described in Files and Directories, this demo contains:

File or directoryDescription
src/demo/reliability/reqresp/client/

Client source code

src/demo/reliability/reqresp/server/

Server source code

wsdl/ReqRespService.wsdl

Service WSDL file

Building and Running Demos  Locate

You can run the demo using "run.sh" or "run.bat" scripts. The script on invocation without arguments prints out a help message.

  1. Compile and publish request/response service (located in src/demo/reliability/reqresp/server). Runtime publication of a reliability-aware service is demonstrated there.

    Windows: run.bat make_server
             run.bat run_server
    Linux:   ./run.sh make_server
             ./run.sh run_server (use a new terminal)
                    
  2. Make client classes ...

    Windows: run.bat make_client
    Linux:   ./run.sh make_client
                    
  3. Run the ReqRespClient (it calls ReqRespService). You can try to run the client while the server is offline, then start the server and try to run the client again. Now, messages scheduled for delivery when the server was offline will be sent to the server. You can also interrupt (shutdown) the client or the server during an invocation. You can see that they will continue with incomplete sequences after restart.

    [Warning]Warning

    SESJ currently does not support persistent response receipts, therefore the client will not be able to retrieve responses to messages sent before the client restart.

    Windows: run.bat run_client [anonymous]
    Linux:   ./run.sh run_client [anonymous]
                    

    You can also run an anonymous client by using "run_client anonymous" instead of "run_client" as the target.

    If you wish to follow the progress of the invocation with SoapSpy, perform the following:

    1. Run server_java60/bin/soapspy.bat or soapspy.sh. This will bring up the SoapSpy GUI.

    2. Start spying by selecting Start Spying from the Spy menu or by clicking the spy icon in the main pane.

    3. Run the client using the run spy_client command instead of run_client.