PROPID_M_CLASS

The PROPID_M_CLASS property indicates message type. A message can be a normal MSMQ message, a positive or negative (arrival and read) acknowledgment message, or a report message. Typically this property is set by MSMQ when it sends the message, however it can also be set by an MSMQ connector application when the connector application sends a message.

Type Indicator
VT_UI2 (or VT_NULL)
PROPVARIANT Field
uiVal

Property Values

Normal messages (all messages created by your application):

MQMSG_CLASS_NORMAL
A normal MSMQ message.

Positive acknowledgment messages (typically 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 (typically generated by MSMQ):

MQMSG_CLASS_NACK_ACCESS_DENIED
The sending application does not have access rights to the destination queue.
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 PROPID_M_PRIV_LEVEL).
MQMSG_CLASS_NACK_BAD_SIGNATURE
MSMQ could not authenticate the original message. The original message's digital signature is not valid.
MQMSG_CLASS_NACK_COULD_NOT_ENCRYPT
The source Queue Manager could not encrypt a private message (PROPID_M_PRIV_LEVEL).
MQMSG_CLASS_NACK_HOP_COUNT_EXCEEDED
The original message's hop count is exceeded.
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 could reach the destination queue.
MQMSG_CLASS_NACK_PURGED
The message was purged before reaching the destination queue.
MQMSG_CLASS_NACK_NOT_TRANSACTIONAL_Q
A transaction message was sent to a non-transaction queue.
MQMSG_CLASS_NACK_NOT_TRANSACTIONAL_MSG
A non-transaction message was sent to a transaction queue.

Negative read acknowledgment messages (typically 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.

Report messages (typically generated by MSMQ):

MQMSG_CLASS_REPORT
Sent each time the message enters or leaves an MSMQ server.

Remarks

Acknowledgment messages are typically generated by MSMQ whenever the sending application requests them. The acknowledgment message is returned to the administration queue that is specified by the sending application. For information on administration queues, see Administration Queues.

Note  Acknowledgment messages can also be created by MSMQ connector applications. When the connector application creates an acknowledgment message, it must set PROPID_M_CLASS and PROPID_CONNECTOR_TYPE. For additional information, see MSMQ Connector Applications.

Report messages are typically generated by MSMQ whenever a report queue is defined at the source Queue Manager. For information on report queues, see Report Queues.

To find the class of a message, pass PROPID_M_CLASS to MQReceiveMessage and examine the returned value. When passing PROPID_M_CLASS to MQReceiveMessage, the corresponding VT field in the aPropVar array can be set to VT_NULL.

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

Example

This example shows how PROPID_M_CLASS is specified in the MQMSGPROPS structure:

MsgProps.aPropID[i] = PROPID_M_CLASS;    //PROPVARIANT Field
MsgProps.aPropVar[i].vt = VT_UI2;        //Type Indicator

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in mq.h.
  Import Library: Use mqrt.lib.
  Unicode: Defined only as Unicode.

See Also

MQMSGPROPS, MQSendMessage, PROPID_M_ACKNOWLEDGE, PROPID_M_PRIV_LEVEL