4.1 QM Management Action and Retrieving QM Info Example

In the following example, an administrator needs to send messages to a remote queue on a server. First, the administrator queries to see what private queues are available. Next, the administrator chooses one of the queues and begins sending messages to it. While sending the messages, the administrator notices that messages are being put into the dead-letter queue. The administrator decides to stop producers while investigating the issue and to pause the OutgoingQueue abstract data model (ADM) element instance.

QM Management Operations

Figure 3: QM Management Operations

  1. This protocol can be used to determine the available private queues on a remote machine to which the client can send messages. The client retrieves a list of private queue path names by invoking the R_QMMgmtGetInfo (section 3.1.4.1) method with a pObjectFormat parameter type member set to the MGMT_MACHINE enumerated value, as defined in MgmtObjectType (section 2.2.2.1). Next, the client can create a format name pointing to one of the returned queues. Finally, the client can use the events in [MS-MQDMPR] to open the queue of the constructed format name and to enqueue messages to it. The OutgoingQueue ADM element instance that was used to send messages can be used in the subsequent step.

  2. The client can pause an OutgoingQueue ADM element instance by performing the following steps. First, construct a QUEUE_FORMAT ([MS-MQMQ] section 2.2.7) structure of type QUEUE_FORMAT_TYPE_DIRECT and set the m_pDirectID member to the name identifier of a direct queue (as specified in [MS-MQMQ] section 2.1 for the ABNF). Next, construct an MGMT_OBJECT (section 2.2.1.2) structure of type MGMT_QUEUE and set the MGMT_OBJECT.pQueueFormat member to the address of the constructed QUEUE_FORMAT structure instance. Finally, the client pauses the OutgoingQueue ADM element instance by invoking the R_QMMgmtAction (section 3.1.4.2) method with an lpwszAction parameter value equal to "PAUSE" and a pObjectFormat parameter value set to the address of the constructed MGMT_OBJECT structure.