开发者

Does NServiceBus guarantee that messages will be processed in a particular order?

开发者 https://www.devze.com 2023-03-17 21:53 出处:网络
Does NServi开发者_运维百科cebus make sure messages are drawn down from a queue in a particular order like FIFO or LIFO?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消