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



##########
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:
       > can you please clarify the description of this work ?
   > it looks interesting but I do not fully understand the goal
   
   @eolivelli In order to achieve the collection of a message within a given 
time as you mentioned, allowing users to use the Java client to use 
receiverQueueSize(0) to create consumers when receiving overtime




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