Queues

Introduction to IBM® MQ queues and queue attributes.

An IBM MQ queue is a named object on which applications can put messages, and from which applications can get messages.

Messages are stored on a queue, so that if the putting application is expecting a reply to its message, it is free to do other work while waiting for that reply. Applications access a queue by using the Message Queue Interface (MQI), described in The Message Queue Interface overview.

Before a message can be put on a queue, the queue must have already been created. A queue is owned by a queue manager, and that queue manager can own many queues. However, each queue must have a name that is unique within that queue manager.

A queue is maintained through a queue manager. In most cases, each queue is physically managed by its queue manager but this is not apparent to an application program. IBM MQ for z/OS® shared queues can be managed by any queue manager in the queue sharing group.

To create a queue you can use IBM MQ commands (MQSC), PCF commands, or platform-specific interfaces. For example, the IBM MQ for z/OS operations and control panels are platform-specific.

You can create local queues for temporary jobs dynamically from your application. For example, you can create reply-to queues (which are not needed after an application ends). For more information, see Dynamic and Model queues.

Before using a queue, you must open the queue, specifying what you want to do with it. For example, you can open a queue for:
  • Browsing messages only (not retrieving them)
  • Retrieving messages (and either sharing the access with other programs, or with exclusive access)
  • Putting messages on the queue
  • Inquiring about the attributes of the queue
  • Setting the attributes of the queue

For a complete list of the options that you can specify when you open a queue, see MQOPEN - Open object.

Attributes of queues

Some of the attributes of a queue are specified when the queue is defined, and cannot be changed afterward (for example, the type of the queue). Other attributes of queues can be grouped into those that can be changed:
  • By the queue manager during the processing of the queue (for example, the current depth of a queue)
  • Only by commands (for example, the text description of the queue)
  • By applications, using the MQSET call (for example, whether put operations are allowed on the queue)

You can find the values of all the attributes using the MQINQ call.

The attributes that are common to more than one type of queue are:
QName
Name of the queue.
QType
Type of the queue.
QDesc
Text description of the queue.
InhibitGet
Whether programs are allowed to get messages from the queue. However, you can never get messages from remote queues.
InhibitPut
Whether programs are allowed to put messages on the queue.
DefPriority
Default priority for messages put on the queue.
DefPersistence
Default persistence for messages put on the queue
Scope
Controls whether an entry for this queue also exists in a name service.
[z/OS]The Scope attribute is not supported on z/OS

For a full description of these attributes, see Attributes for queues.