Demogorgon314 commented on a change in pull request #13332:
URL: https://github.com/apache/pulsar/pull/13332#discussion_r771177881
##########
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:
You're right. I think moving to the top of the method doesn't change the
behavior.
In the previous implementation, even if `hasMessageAvailableAsync` is true,
the `readNext()` still might blocking.
--
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]