Create dynamic queues
You should use a dynamic queue for those cases where you do not need the queue after your application ends. For example, you may want to 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 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.
There are three ways to specify the name of the dynamic queue you create:
- Give the full name 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 may want each user to use a certain prefix, or you may 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 WebSphere MQ Application Programming Reference.
There is more information on dynamic queues in Dynamic queues.
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.