Send a message from a client to a server


Before starting

Before putting a test message on the queue, we must already have completed the following tasks in this tutorial:


In this part of the tutorial, we will send a message from the client to the server queue manager QM_ORANGE, which uses the remote queue definition and other IBM MQ objects defined in earlier tutorials to route the message onto queue manager QM_APPLE and to queue Q1.

On Windows, the sample programs are installed by default with IBM MQ Server or Client.

On Linux, the sample programs RPM will need to be installed.

Open a command prompt on the client and follow these steps:


Procedure

  1. Start the amqsputc sample program as follows:

    • On Linux, change to the MQ_INSTALLATION_PATH/samp/bin directory, where MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed. Type the command:
      ./amqsputc Q1
    • On Windows, type the command:
      amqsputc Q1

    The following messages are displayed:Sample AMQSPUT0 start
    target queue is Q1

  2. Type some message text on one or more lines, then press Enter twice. The following message is displayed:Sample AMQSPUT0 end


Results

We have now created a test message and sent it to the server queue manager QM_ORANGE, which routes it onto queue Q1 on queue manager QM_APPLE. The next task is to verify that the test message was received. Parent topic: Tutorial 3: Sending a message on a client-server configuration Previous topic: Set up the client on Windows and Linux Next topic: Verify that the test message was sent