You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "crossoverJie (via GitHub)" <gi...@apache.org> on 2023/04/12 07:43:43 UTC

[GitHub] [pulsar] crossoverJie opened a new issue, #20076: [Bug] When consuming messages using messageListener, the ConsumerStats#getMsgNumInReceiverQueue method always returns 0.

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: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] tisonkun commented on issue #20076: [Bug] When consuming messages using messageListener, the ConsumerStats#getMsgNumInReceiverQueue method always returns 0.

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #20076:
URL: https://github.com/apache/pulsar/issues/20076#issuecomment-1505496977

   > `msgNumInReceiverQueue ` returns the actual number of messages that are blocking
   
   I don't think so. When a message arrives to message listener, it's not in the queue. It's users responsibility to track the stats.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] github-actions[bot] commented on issue #20076: [Bug] When consuming messages using messageListener, the ConsumerStats#getMsgNumInReceiverQueue method always returns 0.

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #20076:
URL: https://github.com/apache/pulsar/issues/20076#issuecomment-1546787445

   The issue had no activity for 30 days, mark with Stale label.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] Technoboy- commented on issue #20076: [Bug] When consuming messages using messageListener, the ConsumerStats#getMsgNumInReceiverQueue method always returns 0.

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- commented on issue #20076:
URL: https://github.com/apache/pulsar/issues/20076#issuecomment-1506204558

   > > > `msgNumInReceiverQueue ` returns the actual number of messages that are blocking
   > > 
   > > 
   > > I don't think so. When a message arrives to message listener, it's not in the queue. It's users responsibility to track the stats.
   > 
   > The user is unable to track these messages as they are still stored in the queue of the `externalPinnedExecutor` thread pool, and the user has no way of knowing how many messages are yet to be consumed.
   > 
   > This means moving the data from the `incomingMessages` queue to the `externalPinnedExecutor` queue.
   
   yes, right. Users need to monitor the `externalPinnedExecutor`


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] tisonkun commented on issue #20076: [Bug] When consuming messages using messageListener, the ConsumerStats#getMsgNumInReceiverQueue method always returns 0.

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on issue #20076:
URL: https://github.com/apache/pulsar/issues/20076#issuecomment-1506402954

   @crossoverJie @Technoboy- Thanks for your clarification! Make sense to me.
   
   Looking forward to your patch 😃 


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] crossoverJie commented on issue #20076: [Bug] When consuming messages using messageListener, the ConsumerStats#getMsgNumInReceiverQueue method always returns 0.

Posted by "crossoverJie (via GitHub)" <gi...@apache.org>.
crossoverJie commented on issue #20076:
URL: https://github.com/apache/pulsar/issues/20076#issuecomment-1505603769

   > > `msgNumInReceiverQueue ` returns the actual number of messages that are blocking
   > 
   > I don't think so. When a message arrives to message listener, it's not in the queue. It's users responsibility to track the stats.
   
   The user is unable to track these messages as they are still stored in the queue of the `externalPinnedExecutor` thread pool, and the user has no way of knowing how many messages are yet to be consumed.
   
   This means moving the data from the `incomingMessages` queue to the `externalPinnedExecutor` queue.
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] Technoboy- closed issue #20076: [Bug] When consuming messages using messageListener, the ConsumerStats#getMsgNumInReceiverQueue method always returns 0.

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- closed issue #20076: [Bug] When consuming messages using messageListener, the ConsumerStats#getMsgNumInReceiverQueue method always returns 0.
URL: https://github.com/apache/pulsar/issues/20076


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org