Queues
Introduction to IBM® MQ queues and queue attributes.
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.
- 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
- 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.
- 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.
For a full description of these attributes, see Attributes for queues.
Ways of defining queues
- Whether applications can retrieve messages from the queue (GET enabled)
- Whether applications can put messages on the queue (PUT enabled)
- Whether access to the queue is exclusive to one application or shared between applications
- The maximum number of messages that can be stored on the queue at the same time (maximum queue depth)
- The maximum length of messages that can be put on the queue
There are also various platform-specific interfaces that you can use to define queues.