共用方式為


MSMQMessage.Class

 

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

The Class property of the MSMQMessage object provides the message type set by Message Queuing. A message can be a normal Message Queuing message, a positive or negative (arrival and read) acknowledgment message, or a report message. For negative acknowledgment messages, the value of this property indicates why the message did not arrive or was not retrieved.

This property is superseded by MSMQMessage.MsgClass in MSMQ 2.0 and later.

Data type: Long
Run-time access: Read-only
Property Class As Long  

Property Value

Message Queuing sets the Class property to one of the following values:

Normal messages (all messages created by your application):

MQMSG_CLASS_NORMAL

A normal Message Queuing message.

Positive acknowledgment messages (generated by MSMQ):

MQMSG_CLASS_ACK_REACH_QUEUE

The original message reached its destination queue.

MQMSG_CLASS_ACK_RECEIVE

The original message was retrieved by the receiving application.

Negative arrival acknowledgment messages (generated by MSMQ):

MQMSG_CLASS_NACK_ACCESS_DENIED

The access rights for placing messages in the destination queue are not allowed for the sending application.

MQMSG_CLASS_NACK_BAD_DST_Q

The destination queue is not available to the sending application.

MQMSG_CLASS_NACK_BAD_ENCRYPTION

The destination queue manager could not decrypt a private (encrypted) message (see MSMQMessage.PrivLevel).

MQMSG_CLASS_NACK_BAD_SIGNATURE

Message Queuing could not authenticate the original message. The digital signature attached to the original message is not valid.

MQMSG_CLASS_NACK_COULD_NOT_ENCRYPT

The source queue manager could not encrypt a private message (see MSMQMessage.PrivLevel).

MQMSG_CLASS_NACK_HOP_COUNT_EXCEEDED

The original message's hop count is exceeded.

MQMSG_CLASS_NACK_NOT_TRANSACTIONAL_MSG

A nontransactional message was sent to a transactional queue.

MQMSG_CLASS_NACK_NOT_TRANSACTIONAL_Q

A transactional message was sent to a nontransactional queue.

MQMSG_CLASS_NACK_PURGED

The message was purged before reaching the destination queue.

MQMSG_CLASS_NACK_Q_EXCEED_QUOTA

The original message's destination queue is full.

MQMSG_CLASS_NACK_REACH_QUEUE_TIMEOUT

Either the time-to-reach-queue or time-to-be-received timer expired before the original message reached the destination queue.

For transactional messages, this is an in-doubt negative acknowledgment. For example, the local queue manager sets this class when the message timer expires, even though a positive confirmation may be in route from the remote queue manager.

MQMSG_CLASS_NACK_UNSUPPORTED_CRYPTO_PROVIDER

The destination queue manager does not have the enhanced (128-bit) cryptographic provider installed.

Negative read acknowledgment messages (generated by MSMQ):

MQMSG_CLASS_NACK_Q_DELETED

The queue was deleted before the message could be read from the queue.

MQMSG_CLASS_NACK_Q_PURGED

The queue was purged and the message no longer exists.

MQMSG_CLASS_NACK_RECEIVE_TIMEOUT

The original message was not removed from the queue before its time-to-be-received timer expired.

For transactional messages, this means that the remote queue manager has indicated that the message was not retrieved. This is the only negative acknowledgment that can be trusted to indicate the message was not retrieved.

MQMSG_CLASS_NACK_RECEIVE_TIMEOUT_AT_SENDER

For transactional messages only. The local queue manager has indicated that the original message was not removed from the queue before its time-to-be-received timer expired.

This class is an in-doubt negative acknowledgment. For example, the local queue manager sets this class when the time-to-be-received timer expires, even though a positive confirmation may be in route from the remote queue manager.

Report messages (generated by MSMQ):

MQMSG_CLASS_REPORT

Sent each time the message enters or leaves a Message Queuing server.

Remarks

Acknowledgment messages are generated by Message Queuing whenever the sending application requests them. Message Queuing returns the appropriate acknowledgment message to the administration queue specified by the sending application. For information on acknowledgment messages, see Acknowledgment Messages.

Transactional messages can have two in-doubt negative acknowledgments: MQMSG_CLASS_NACK_REACH_QUEUE_TIMEOUT and MQMSG_CLASS_NACK_RECEIVE_TIMEOUT_AT_SENDER. These two classes are considered in doubt because they can be set by the local queue manager even though a confirmation notification may be in route from the remote queue manager. The only trusted negative acknowledgment is MQMSG_CLASS_NACK_RECEIVE_TIMEOUT, because this class is set by the remote queue manager.

Report messages are generated by Message Queuing whenever a report queue is defined at the source queue manager.

When reading messages in an administration queue or dead-letter queue, retrieve Class to find out why the message was sent to the queue.

You can also retrieve the class of a message when using Message Queuing function calls.

Equivalent API Function Property

With API function calls, the equivalent property is PROPID_M_CLASS.

Requirements

Windows NT/2000/XP: Included in Windows NT 4.0 SP3 and later.

Windows 95/98/Me: Included in Windows 95 and later.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib.

See Also

MSMQMessage
MSMQMessage.MsgClass
MSMQMessage.PrivLevel
PROPID_M_CLASS