本文介绍了如何获取MassTransit IBus的大小(消息数)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 MassTransit 库的InMemoryMessageBus,我想知道如何获取队列中消息的数量(总线的大小).

I'm using the MassTransit library's InMemoryMessageBus and I would like to know how I can get the number of messages in the queue (the size of the bus).

推荐答案

使用内存传输的任何特定队列中的消息数不可用.消息传递基于排队的任务调度程序,并且消息计数尚未可用.我不确定它们是否可以(很容易.很可能.但是实用是另一回事).

The number of messages in any particular queue using the in-memory transport is not available. The message delivery is based on a queued task scheduler, and the message counts have not been made available. I'm not sure if they could be or not (well, easily. Anything is possible, but practical is another matter).

更新:此内容已添加到MassTransit中,并将在下一版本(3.5.x)中发布. 跟踪问题在GitHub上,包括新代码的示例用法.

UPDATE: This was added to MassTransit and will be in the next release (3.5.x). The tracking issue is on GitHub, including example usage of the new code.

这篇关于如何获取MassTransit IBus的大小(消息数)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 01:48