Does NServi开发者_运维百科cebus make sure messages are drawn down from a queue in a particular order like FIFO or LIFO?
Thx
NServiceBus doesn't guarantee that messages will be processed in order (as far as im aware). Even if you ran a single thread, you can't guarantee that message 2 doesn't arrive before message 1.
I did a quick google search and also found:
http://mikaelkoskinen.net/post/NServiceBus-In-order-message-processing.aspx
Which seems to test the scenario, but came to the conclusion:
Conclusion
NServiceBus doesn’t handle messages in-order. It’s up to the developer to make sure that the relevant messages are handler in the right order. The easiest way to do this is to send messages as batches from the client.
Also if a message fails for some reason, it will be thrown to the back of the queue, and processed out of order from the previous related messages.
精彩评论