Putting a test message on the local queue
Before you begin
Before putting a test message on the queue, you 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:
Putting a test message on the queue using IBM MQ Explorer
Procedure
- In the Navigator view, expand the Queue Managers folder.
- Expand queue manager QM_APPLE, which you created.
- Click the Queues folder. The queues of the queue manager are listed in the Content view.
- In the Content view, right-click the local queue Q1, then click Put Test Message. The Put test message dialog opens.
- 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.
- Click Close.
Results
In the Content view, notice that Q1's 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.
Putting 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
- 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
Sample AMQSPUT0 start
target queue is Q1 - 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:
- 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 put it onto the local queue.In the IBM MQ Explorer Content view, notice that Q1's 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.