crossoverJie opened a new issue, #20076: URL: https://github.com/apache/pulsar/issues/20076
### Search before asking - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar. ### Version all version ### Minimal reproduce step ```java .messageListener(new MessageListener<byte[]>() { @SneakyThrows @Override public void received(Consumer<byte[]> consumer, Message<byte[]> msg) { TimeUnit.SECONDS.sleep(100); consumer.acknowledge(msg); } }) Integer msgNumInReceiverQueue = consumer.getStats().getMsgNumInReceiverQueue(); ``` When consuming messages using messageListener, the `msgNumInReceiverQueue` is always 0. ### What did you expect to see? `consumer.getStats().getMsgNumInReceiverQueue()` returns the actual number of messages that are blocking. ### What did you see instead? the `msgNumInReceiverQueue` is always 0. ### Anything else? As all messages are written to an unbounded queue in `externalPinnedExecutor`, should we consider adding a counter here to record the number of unconsumed messages? ### Are you willing to submit a PR? - [X] I'm willing to submit a PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
