Just wanted to get confirmation on how sending messages to remote transactional message queues works.
Suppose I have a two machines, A and B.
Machine A has a transactional queue that is used for receiving messages. A windows service monitors this queue and does something with the data (persists it to a SQL Server).
Machine B is running an application that needs to write to the queue on Machine A.
A few questions:
-
When sending the message, is a local copy created on Machine B, before it gets delivered to machine A?
a. If so, is this behavior by default, or does it only occur when the “IsRecoverable” property is sent?
b. Does the fact that the queue is transactional have any effect on this behavior? -
Since I’m using a transactional queue, where is the data once the transaction commits?
a. Is it sitting locally, waiting for the msmq service to deliver the message to the remote queue?
b. Or Is the message sitting in the queue on the remote machine?
I’m having trouble interpreting the documentation. In some places I see that the store and forward behavior is described, but I’m having trouble understanding whether that is the default behavior with transactional queues or if I need to do something explicitly to get that going.
The main thing to understand about transactional MSMQ is that there are actually 3 distinct transactions involved in a transactional transmission of a message to a remote queue.
So in answer to your questions:
Yes
By default. This is what is known as store and forward.
No except for when there is a failure.
It depends which transaction you mean (see above)
Only if the remote queue is not available.
If the receiver service fails to process the message succesfully (there is an exception in the handler) the message will stay on the remote queue.