共用方式為


PROPID_MGMT_QUEUE_EOD_FIRST_NON_ACK

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

(Read-only, introduced in MSMQ 3.0.) The PROPID_MGMT_QUEUE_EOD_FIRST_NON_ACK property returns sequence information about the first message sent from the computer to the queue for which no order acknowledgment has been received.

Property ID

PROPID_MGMT_QUEUE_EOD_FIRST_NON_ACK

Type Indicator

VT_BLOB

MQPROPVARIANT Field

blob

Property Value

A SEQUENCE_INFO structure containing the sequence information about the message (VT_NULL is returned if the queue is a local queue on the computer).

Remarks

Sequence information can be retrieved for transactional and nontransactional queues.

If the queue manager does not have this information, 0 is returned in the SeqNo and PrevNo members of the SEQUENCE_INFO structure.

To retrieve the sequence information about the first message sent from the computer to the queue for which no order acknowledgment has been received, include PROPID_MGMT_QUEUE_EOD_FIRST_NON_ACK in an MQMGMTPROPS structure, and then call MQMgmtGetInfo.

This property can be retrieved only for an active queue. MQMgmtGetInfo will return a non-specific error (MQ_ERROR) if your application attempts to retrieve this information for a queue that does not contain messages and is not opened by an application.

When specifying PROPID_MGMT_QUEUE_EOD_FIRST_NON_ACK in the MQMGMTPROPS structure, set its type indicator to VT_NULL. During the function call, Message Queuing automatically changes the type indicator to VT_BLOB and allocates memory for a BLOB buffer that receives the sequence information.

The sequence information can be extracted from the buffer after creating a pointer to a SEQUENCE_INFO structure and equating the pointer to the BLOB data to this pointer with the necessary casting. After you no longer need the BLOB buffer, you must free the memory allocated for it using MQFreeMemory.

Equivalent COM Property

When using COM components, you can retrieve sequence information about the first message sent from a computer to a queue for which no order acknowledgment has been received by examining the EodFirstNonAck element of the MSMQCollection object returned by the MSMQOutgoingQueueManagement.EodGetSendInfo method. This element is, in turn, an MSMQCollection object containing three elements: SeqID, SeqNo, and PrevNo.

Example Code

The following code fragment shows how PROPID_MGMT_QUEUE_EOD_FIRST_NON_ACK is specified in arrays that can be used to initialize an MQMGMTPROPS structure.

aMgmtPropId[i] = PROPID_MGMT_QUEUE_EOD_FIRST_NON_ACK;  // Property ID  
aMgmtPropVar[i].vt = VT_NULL;                          // Type indicator  
i++;  

The following code fragment shows how to extract and display the sequence information.

SEQUENCE_INFO* pSeqInfo;  
pSeqInfo = reinterpret_cast<SEQUENCE_INFO*>(propVar[i].blob.pBlobData);  
wprintf(L"Sequence ID: %I64d\n", pSeqInfo->SeqID);  
wprintf(L"Sequence number: %d\n", pSeqInfo->SeqNo);  
wprintf(L"Previous sequence number: %d\n", pSeqInfo->PrevNo);  

The following line of code shows how to free the memory allocated for the sequence information.

MQFreeMemory(aMgmtPropVar[i].blob.pBlobData);  

See Also

Management Properties
EodFirstNonAck
MQFreeMemory
MQMgmtGetInfo
MQMGMTPROPS
MSMQCollection
SEQUENCE_INFO