Put a test message on the local queue


Before starting

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


This topic shows how to put a test message on the local queue Q1.You can perform this task using either of the following interfaces:

Parent topic: Tutorial 1: Sending a message to a local queue Previous topic: Create the local queue Next topic: Verify that the test message was sent


Put a test message on the queue using IBM MQ Explorer


Procedure

  1. In the Navigator view, expand the Queue Managers folder.
  2. Expand queue manager QM_APPLE, which you created.
  3. Click the Queues folder. The queues of the queue manager are listed in the Content view.
  4. In the Content view, right-click the local queue Q1, then click Put Test Message. The Put test message dialog opens.
  5. In the Message data field, type some text, for example this is a test message, then click Put message. The Message data field is cleared and the message is put on the queue.
  6. Click Close.


Results

In the Content view, notice that the Q1 Current queue depth value is now 1, as shown in the following screen capture:

If the Current queue depth column is not visible, you might need to scroll sideways in the Content View.


Put a test message on the queue using amqsput

About this task

The amqsput sample program is used to put a message on the queue that you created.

On Windows the sample programs are installed by default with IBM MQ Server or Client. On Linux, the samples programs RPM need to be installed.

Open a command prompt and follow these steps:

Procedure

  1. Start the amqsput 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:
      ./amqsput Q1 QM_APPLE
    • On Windows, type the command:
      amqsput Q1 QM_APPLE

    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 put it onto the local queue.

In the IBM MQ Explorer Content view, notice that the Q1 Current queue depth value is now 1, as shown in the following screen capture:

If the Current queue depth column is not visible, you might need to scroll sideways in the Content View.