Working with model queues
A queue manager creates a dynamic queue if it receives an MQI call from an application specifying a queue name that has been defined as a model queue. The name of the new dynamic queue is generated by the queue manager when the queue is created. A model queue is a template that specifies the attributes of any dynamic queues created from it. Model queues provide a convenient method for applications to create queues as required.
Defining a model queue
DEFINE QMODEL (GREEN.MODEL.QUEUE) +
DESCR('Queue for messages from application X') +
PUT (DISABLED) +
GET (ENABLED) +
NOTRIGGER +
MSGDLVSQ (FIFO) +
MAXDEPTH (1000) +
MAXMSGL (2000) +
USAGE (NORMAL) +
DEFTYPE (PERMDYN)
This command creates a model queue definition. From the DEFTYPE attribute, you can see that the actual queues created from this template are permanent dynamic queues. Any attributes not specified are automatically copied from the SYSYTEM.DEFAULT.MODEL.QUEUE default queue.
You can use the LIKE and REPLACE attributes when you define model queues, in the same way that you use them with local queues.
Using other commands with model queues
You can use the appropriate MQSC commands to display or alter a model queue's attributes, or to delete the model queue object. For example:
DISPLAY QUEUE (GREEN.MODEL.QUEUE)
Use the ALTER QMODEL command to alter the model to enable puts on any dynamic queue created from this model:
ALTER QMODEL (BLUE.MODEL.QUEUE) PUT(ENABLED)
Use the DELETE QMODEL command to delete this model queue:
DELETE QMODEL (RED.MODEL.QUEUE)