In MassTransit, I'd like to make an ASP .NET Core healthcheck that considers my app in "degraded health" state, when the "prefetch buffer" is full, and the amount of consumes per second is low enough.
In other words, if there are still messages on the queue, and the consumer is slow. I'll then use this to configure AWS to autoscale my consumers based on the health.
Is there a way to access the amount of messages that have been prefetched, from the outside? Or is this entirely encapsulated within MassTransit?
I'm using ActiveMQ as the underlying transport.