开发者

MaxConcurrentListeners and Remote Transactional Reads from MSMQ

开发者 https://www.devze.com 2023-02-02 22:58 出处:网络
Could it be that MaxConcurrentListereners on a DistributedTxMessageListenerContainer isn\'t much of use? I have the impression that only one thread at a time can handle a message from the开发者_StackO

Could it be that MaxConcurrentListereners on a DistributedTxMessageListenerContainer isn't much of use? I have the impression that only one thread at a time can handle a message from the开发者_StackOverflow queue. Maybe it's logical since the message will only be removed from the queue once the transaction is successfull. Or am I wrong here?


Yes, only one thread can receive a particular message from a queue.
Multiple threads can be receiving messages from a queue at any one time, though.
When a message is transactionally received from a queue, it becomes invisible to all other threads until the transaction aborts of commits.
If it aborts then the message reappears in the queue (made visible again); if it commits then the message is physically deleted from the queue.

Cheers
John Breakwell

0

精彩评论

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

关注公众号