MaxConcurrentListeners 和来自 MSMQ 的远程事务读取

发布于 2024-10-10 13:22:53 字数 147 浏览 0 评论 0原文

难道 DistributedTxMessageListenerContainer 上的 MaxConcurrentListereners 没有多大用处吗?我的印象是一次只有一个线程可以处理队列中的消息。也许这是合乎逻辑的,因为只有在事务成功后消息才会从队列中删除。还是我这里错了?

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 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

维持三分热 2024-10-17 13:22:53

是的,只有一个线程可以从队列接收特定消息。
不过,多个线程可以同时从队列接收消息。
当从队列中以事务方式接收消息时,它对所有其他线程都变得不可见,直到事务中止提交为止。
如果中止,则消息将重新出现在队列中(再次可见);如果提交,则该消息将从队列中物理删除。

干杯
约翰·布瑞克威尔

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文