Checking for Transaction Boundaries when Receiving Messages
Message Queuing provides three message properties that can be used by the receiving application to check the transaction boundaries of the messages in a queue. This includes a property that identifies which transaction sent the message, and two properties that indicate if the message was the first or last message sent in the transaction. Together, these three properties can be used to check the transaction boundaries of a transaction issued by a single computer to a single transaction queue.
The receiving application can use these properties to detect if any messages have been lost while they are in the receiving queue.
|Message Queuing guarantees that all messages sent to a specific transactional queue will be delivered once and that they will arrive in the order in which they were sent within the transaction. However, Message Queuing cannot guarantee that messages will not be lost after the sending application commits the transaction.|
Messages can be lost because of incorrect encryption, failed authentication, insufficient permissions, and time-out events.
For example, the following illustration shows a destination queue with messages from two transactions: transaction A and transaction B (note that the sequence of the messages indicates that the sending application committed transaction A, then committed to transaction B).
If the receiving application finds the first message from transaction B before it finds the last message from transaction A, it knows that at least one message, the last message from transaction A, has been lost. Note that you can only check to see if the first or last message from the transaction was lost.
|For information on||See|
How messages are placed in the queue
|For an example of||See|
Checking transaction boundaries