Getting a message from the queue LQ1

Get a message from the queue LQ1, for use with the Getting started with IBM® WebSphere® MQ Version 7.5 scenario, by using either the command-line interface or IBM WebSphere MQ Explorer.

About this task

IBM WebSphere MQ comes with a sample application called amqsget. This application reads messages from a queue.

Getting a message from the queue using the command-line interface

To get a message from the queue by using the command-line interface, complete the following steps:

Procedure

Use the amqsget sample application to read a message on the queue LQ1, by typing the following command:
amqsget LQ1 QM1
When the sample application starts, the following output is displayed:
C:\>amqsget LQ1 QM1
Sample AMQSGET0 start
message <Hello World>
no more messages
Sample AMQSGET0  end
The amqsget application ends 30 seconds after reading the message.

What to do next

To learn about writing queuing applications, connecting to and disconnecting from a queue manager, publish/subscribe, and opening and closing objects, see Writing a queuing application.

Getting a message from the queue by using IBM WebSphere MQ Explorer

To get a message from the queue by using the IBM WebSphere MQ Explorer, complete the following steps:

Procedure

  1. In the Navigator view, expand the Queue Managers folder, then expand QM1.
  2. Click the Queues folder.
  3. In the Content view, right-click QM1, then click Browse Messages.... The Message browser opens to show the list of the messages that are currently on QM1.
  4. Double-click the last message to open the properties dialog.

    On the Data page of the properties dialog, the Message data field displays the content of the message in human-readable form.

What to do next

To learn about writing queuing applications, connecting to and disconnecting from a queue manager, publish/subscribe, and opening and closing objects, see Writing a queuing application.