Create dynamic queues
Use a dynamic queue when you do not need the queue after your application ends. For example, you could use a dynamic queue for your reply-to queue. You specify the name of the reply-to queue in the ReplyToQ field of the MQMD structure when you put a message on a queue (see Defining messages using the MQMD structure).
To create a dynamic queue, you use a template known as a model queue, together with the MQOPEN call. You create a model queue using the WebSphere MQ commands or the operations and control panels. The dynamic queue that you create takes the attributes of the model queue.
When you call MQOPEN, specify the name of the model queue in the ObjectName field of the MQOD structure. When the call completes, the ObjectName field is set to the name of the dynamic queue that is created. Also, the ObjectQMgrName field is set to the name of the local queue manager.
We can specify the name of the dynamic queue that you create in three ways:
- Give the full name that you want in the DynamicQName field of the MQOD structure.
- Specify a prefix (fewer than 33 characters) for the name, and allow the queue manager to generate the rest of the name. This means that the queue manager generates a unique name, but you still have some control (for example, you might want each user to use a certain prefix, or you might want to give a special security classification to queues with a certain prefix in their name). To use this method, specify an asterisk (*) for the last non-blank character of the DynamicQName field. Do not specify a single asterisk (*) for the dynamic queue name.
- Allow the queue manager to generate the full name. To use this method, specify an asterisk (*) in the first character position of the DynamicQName field.
For more information about these methods, see the description of the DynamicQName field in the Application Programming Reference.
There is more information on dynamic queues in Dynamic queues.
Parent topic:
Opening and closing objects
fg12280_