Sending a message from a client to a server

Before you begin

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

About this task

In this part of the tutorial, you 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.

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

[Linux]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:
    • [Linux]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
    • [Windows]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

You 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.