You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/12/17 06:24:59 UTC
[GitHub] [pulsar] eolivelli commented on a change in pull request #13332: [pulsar-client] Fix multi topic reader has message available behavior
eolivelli commented on a change in pull request #13332:
URL: https://github.com/apache/pulsar/pull/13332#discussion_r771131501
##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java
##########
@@ -779,7 +779,7 @@ public boolean hasMessageAvailable() throws PulsarClientException {
if (exception != null) {
completableFuture.completeExceptionally(exception);
} else {
- completableFuture.complete(hasMessageAvailable.get());
+ completableFuture.complete(hasMessageAvailable.get() || numMessagesInQueue() > 0);
Review comment:
What about moving the check on the number of messages on the top of the method?
If we have messages we can skip doing the other things.
Bu the way I am not sure if doing so would alter the way it works significantly, as in case of having messages we won't call hasMessageAvailableAsync on the wrapped consumers
Did you think about this possibility?
--
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