6.7.2. Running the Request/Response Examples

6.7.2. Running the Request/Response Examples

The example programs discussed in this section are found in /usr/share/doc/rhm-0.2/java/. Copy this directory to a location where you have write privileges. To run these programs, do the following:

  1. Make sure that a qpidd broker is running:

    $ ps -eaf | grep qpidd
    

    If a broker is running, you should see the qpidd process in the output of the above command. If no broker is running, see the instructions in Chapter 3, Installing MRG Messaging.

  2. In the java directory, use runSample.sh to run the Server program:

    $ ./runSample.sh org.apache.qpid.example.jmsexample.requestResponse.Server
    Using QPID_HOME: /usr/share/java/
    Using QPID_SAMPLE: /usr/share/doc/rhm-0.2
    Server: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
    Server: Creating a non-transacted, auto-acknowledged session
    Server: Creating a MessageConsumer
    Server: Creating a MessageProducer
    Server: Starting connection so MessageConsumer can receive messages
    
  3. In a separate window, use runSample.sh to run the Client program:

    $ ./runSample.sh org.apache.qpid.example.jmsexample.requestResponse.Client
    Using QPID_HOME: /usr/share/java/
    Using QPID_SAMPLE: /usr/share/doc/rhm-0.2
    Client: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
    Client: Creating a non-transacted, auto-acknowledged session
    Client: Creating a QueueRequestor
    Client: Starting connection
    Client:         Request Content= Twas brillig, and the slithy toves
    Client:         Response Content= TWAS BRILLIG, AND THE SLITHY TOVES
    Client:         Request Content= Did gire and gymble in the wabe.
    Client:         Response Content= DID GIRE AND GYMBLE IN THE WABE.
    Client:         Request Content= All mimsy were the borogroves,
    Client:         Response Content= ALL MIMSY WERE THE BOROGROVES,
    Client:         Request Content= And the mome raths outgrabe.
    Client:         Response Content= AND THE MOME RATHS OUTGRABE.
    Client: Closing connection
    Client: Closing JNDI context