PROPID_M_CLASS (Windows Embedded CE 6.0)

1/6/2010

This property indicates the message type. A message can be one of the following:

  • A normal MSMQ message
  • A positive or negative (arrival and read) acknowledgment message
  • 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 arrival acknowledgment message (typically generated by MSMQ)

  • MQMSG_CLASS_ACK_REACH_QUEUE
    The original message reached its destination queue.

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_Q_PRIV_LEVEL).
  • MQMSG_CLASS_NACK_BAD_SIGNATURE
    MSMQ could not authenticate the original message. The digital signature of the original message 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 hop count of the original message is exceeded.
  • MQMSG_CLASS_NACK_Q_EXCEED_QUOTA
    The destination queue of the original message is full.
  • MQMSG_CLASS_NACK_REACH_QUEUE_TIMEOUT
    The time-to-reach-queue or the time-to-be-received timer expired before the original message could reach the destination queue.

    For a transactional message, this is an in-doubt negative acknowledgment.

    For example, the local Queue Manager sets this class when the message timer expires if even though a positive confirmation is in route from the remote queue manager.

  • MQMSG_CLASS_NACK_PURGED
    The message was purged before reaching the destination queue.
  • MQMSG_CLASS_NACK_NOT_TRANSACTIONAL_Q
    A transactional message was sent to a nontransactional queue.
  • MQMSG_CLASS_NACK_NOT_TRANSACTIONAL_MSG
    A nontransactional message was sent to a transactional queue.
  • MQMSG_CLASS_NACK_UNSUPPORTED_CRYPTO_PROVIDER
    The target Queue Manager does not have the enhanced (128-bit) cryptographic provider installed.

Positive read acknowledgment message (typically generated by MSMQ)

  • MQMSG_CLASS_ACK_RECEIVE
    The original message was retrieved by the receiving application.

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.

    For a transactional message, the remote Queue Manger 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 Manger 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 if a positive confirmation is in route from the remote Queue Manager.

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 when the sending application requests them. The acknowledgment message is returned to the administration queue that is specified by the sending application.

Transactional messages can have two in-doubt negative acknowledgments:

  • MQMSG_CLASS_NACK_REACH_QUEUE_TIMEOUT
  • MQMSG_CLASS_NACK_RECEIVE_TIMEOUT_AT_SENDER

These classes are considered in doubt because they can be set by the local queue manager even if a confirmation notification is in route from the remote Queue Manger.

The only trusted negative acknowledgment is MQMSG_CLASS_NACK_RECEIVE_TIMEOUT, because this class is set by the remote Queue Manager.

Report messages are typically generated by MSMQ when a report queue is defined at the source Queue Manager.

To retrieve the class of the message, specify PROPID_M_CLASSin the MQMSGPROPS structure. Then call MQReceiveMessage and examine the returned value.

When specifying PROPID_M_CLASS, you can set its Type Indicator to VT_NULL. When the Type Indicator is set to VT_NULL, MSMQ sets the VT field to the appropriate type indicator.

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.

Examples

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
i++;

Note

OS versions prior to 2.12 require the MSMQ add-on pack.

Requirements

Header mq.h
Windows Embedded CE Windows CE 2.0 and later

See Also

Reference

MSMQ Properties
MQReceiveMessage
PROPID_M_ACKNOWLEDGE
PROPID_Q_PRIV_LEVEL
MQMSGPROPS