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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]