Share via


Requesting Source Journaling (COM) (Windows Embedded CE 6.0)

1/6/2010

Source journaling is requested by setting the journaling property of a message to MQMSG_JOURNAL, MQMSG_DEADLETTER, or both.

To track messages that were successfully sent by the local computer, set the journaling property of the message to MQMSG_JOURNAL. This tells Message Queuing to always save a copy of each message that it successfully sent.

This means that when you send messages to remote computers, a copy of the message is placed in the source computer's journal queue if the message was sent successfully. Note that this does not mean the message has successfully reached its destination queue, only that the computer was able to send the message.

On the other hand, when you send messages to local queues, a copy of the message is saved to the computer's journal queue only after the message has been removed from the local destination queue.

Message Queuing never stores more than one copy of a message on a single computer at one time. Therefore, if the local destination queue has also enabled target journaling, a copy of the message is placed in that queue's journal when the message is removed from the queue; the message is not, however, saved to the computer's journal queue.

On the other hand, if the local destination queue has not enabled target journaling, a copy of the message is placed in the computer's journal when the message is removed from the destination queue.

To track messages that were not delivered, set the journaling property of the message to MQMSG_DEADLETTER. When you specify this type of source journaling, Message Queuing reacts differently depending on the type of message you send.

For non-transactional messages, a copy of the message is placed in the dead-letter queue of any computer that cannot deliver the message. This can be the source computer, or any routing server used to pass the message on to its destination.

For transactional messages, a copy of the message is placed in the transactional dead letter queue of the source computer only if Message Queuing does not confirm that the message was retrieved from its destination queue.

Confirmation is not returned if the message is not delivered, was not received, or the receiving transaction was aborted.

These messages may be used as a guaranteed negative acknowledgment.

Note

For transactional messages, MSMQ 1.0 and MSMQ 2.0 act differently.

MSMQ 1.0 only allows you to choose if you want to save copies of messages sent successfully. MSMQ 1.0 always sends non-confirmed transactional message to the transactional dead-letter queue, regardless of whether MQMSG_DEADLETTER is or is not specified.

MSMQ 2.0 allows complete control over source journaling. (If you are running MSMQ 1.0 applications on an MSMQ 2.0 computer, you can force the computer to use the MSMQ 1.0 semantics by setting the XactDeadLetterAlways registry entry to 1.)

This procedure sends a non-transactional message to a remote queue, setting the journaling property to MQMSG_JOURNAL, which means a copy of the message will be saved if the message is successfully sent.

To request source journaling

  1. Declare the MSMQQueueInfo, MSMQQueue, and MSMQMessage variables for sending the message.

  2. Call MSMQQueueInfo.Open to open the destination queue with send access.

  3. Set MSMQMessage.Journal to MQMSG_JOURNAL.

  4. Call MSMQMessage.Send to send the message.

  5. Call MSMQQueue.Close to close the queue.

See Also

Concepts

Requesting Journaling (COM)
MSMQ COM Support
Using the COM Components
MSMQ Security

Other Resources

Message Queuing