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:
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.