+

Search Tips | Advanced Search

Get messages from a queue

Use this information to learn about getting messages from a queue.

We can get messages from a queue in two ways:
  1. We can remove a message from the queue so that other programs can no longer see it.
  2. We can copy a message, leaving the original message on the queue. This is known as browsing. We can remove the message once we have browsed it.
In both cases, we use the MQGET call, but first our application must be connected to the queue manager, and you must use the MQOPEN call to open the queue (for input, browse, or both). These operations are described in Connecting to and disconnecting from a queue manager and Opening and closing objects.

When we have opened the queue, we can use the MQGET call repeatedly to browse or remove messages on the same queue. Call MQCLOSE when we have finished getting all the messages that you want from the queue.

Use the following links to find out more about getting messages from a queue: