codelipenghui commented on a change in pull request #11455:
URL: https://github.com/apache/pulsar/pull/11455#discussion_r679590125



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java
##########
@@ -929,6 +935,9 @@ protected void callMessageListener(Message<T> msg) {
         } catch (Throwable t) {
             log.error("[{}][{}] Message listener error in processing message: 
{}", topic, subscription,
                     msg.getMessageId(), t);
+        } finally {
+            executorQueueSize.decrementAndGet();
+            triggerListener();

Review comment:
       Does this one will consume too many CPU cycles if the condition 
`executorQueueSize.get() < conf.getReceiverQueueSize()` = false for a while?

##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java
##########
@@ -895,24 +897,28 @@ private void pendingBatchReceiveTask(Timeout timeout) 
throws Exception {
     protected void triggerListener() {
         // Trigger the notification on the message listener in a separate 
thread to avoid blocking the networking
         // thread while the message processing happens
-        Message<T> msg;
-        do {
-            try {
-                msg = internalReceive(0, TimeUnit.MILLISECONDS);
+        try {
+            while (executorQueueSize.get() < conf.getReceiverQueueSize()) {

Review comment:
       Looks zero queue consumer could not receive messages?




-- 
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]


Reply via email to