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).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With