I am currently evaluating the suitability of Apache Pulsar for building a distributed task queue using a "shared" subscription.
One required feature is to get all queued tasks for certain topics, or to get at least the number of queued tasks.By this I mean all messages for a given subscription that have not been received by the subscription consumers yet. Is this possible, and if so, how?
you can request the subscription's stats https://pulsar.apache.org/docs/next/administration-stats/#subscription-stats through the Admin API - the
msgBacklogvalue should give you what you are looking for.