linlinnn commented on a change in pull request #10544:
URL: https://github.com/apache/pulsar/pull/10544#discussion_r643693410



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java
##########
@@ -184,6 +191,50 @@ protected ConsumerBase(PulsarClientImpl client, String 
topic, ConsumerConfigurat
         return internalReceive(timeout, unit);
     }
 
+    @Override
+    public CompletableFuture<Message<T>> receiveAsync(int timeout, TimeUnit 
unit) {
+
+        if (listener != null) {
+            return FutureUtil.failedFuture(new 
PulsarClientException.InvalidConfigurationException(
+                    "Cannot use receive() when a listener has been set"));
+        }
+        try {
+            verifyConsumerState();
+        } catch (PulsarClientException e) {
+            return FutureUtil.failedFuture(e);
+        }
+
+        ScheduledExecutorService messageScheduledFuture = 
Executors.newSingleThreadScheduledExecutor(

Review comment:
       Yes, we should let it run as user expected, look forward to it.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to