Reputation: 9440
Here's the scenario:
2 Machines: "Machine A" and "Machine B".
Let's sat that their corresponding IP addresses are 192.168.0.100 (for A) and 192.168.0.200 (for B). Both machines have MSMQ installed on them, on Windows Server 2008.
Has the following queue configured: private$\aaa
, transactional.
Has a single consumer for that queue, which wraps every Read
action in an MSMQ transaction, and reads only from the "current" message (that is, no cursor operations are used).
Has a single application that sends messages to FormatName:direct=os:192.168.0.100\private$\aaa
. Each Send
message is wrapped in an MSMQ transaction, with (code in C#):
TimeToReachQueue = Message.InfiniteTimeout
and
TimeToBeReceived = Message.InfiniteTimeout
Under this scenario and configuration of private$\aaa
, are the messages sent from B to A:
M1
cannot be sent from B to A, because of network problems, and then, perhaps, the network is back to normal, and the following message, M2
, is successfully sent to machine A?Thanks a lot!
Upvotes: 1
Views: 136
Reputation: 24017
Delivered Once is guaranteed, but keep in mind that you have a transactional queue, so if message processing fails the first time, then it'll be delivered again until it either succeeds or gets moved to a poisoned message queue. Therefore "Delivered Once" is only guaranteed within that context, and if the other resources you manipulate are also transactional and participate in the distributed transaction then you should be safe.
Messages are "sent together, in the order they were sent, or not at all". See MSMQ Tips
Upvotes: 3