Pulsar backlog message count always returned as zero

36 views Asked by At

I want to know the number of messages in a pulsar partitioned topic that isn't picked up by any of the consumers yet. My application is in python so I am using the REST APIs. I tried both /admin/v2/persistent/public/default/{topic-name}/backlog and /admin/v2/persistent/public/default/{topic-name}/stats endpoints.

Both APIs always return message backlog as zero even when I have unacknowledged messages in the topic.

How can I get unacknowledged message count on a pulsar topic?

1

There are 1 answers

0
VVictor On

For partitioned pulsar topics, you have to use partition name instead of the topic name in admin APIs. Using /admin/v2/persistent/public/default/{partitioned-topic}/stats gives the topic status including message backlog