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



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ZeroQueueConsumerImpl.java
##########
@@ -56,6 +62,45 @@ public ZeroQueueConsumerImpl(PulsarClientImpl client, String 
topic, ConsumerConf
         super(client, topic, conf, executorProvider, partitionIndex, 
hasParentConsumer, subscribeFuture,
                 startMessageId, 0 /* startMessageRollbackDurationInSec */, 
schema, interceptors,
                 createTopicIfDoesNotExist);
+        //Actually,i want to achieve to
+        this.messageScheduledFuture = 
Executors.newSingleThreadScheduledExecutor(
+                new 
DefaultThreadFactory(getClass().getSimpleName()+"-receive-message"));
+    }
+
+
+    @Override
+    protected Message<T> internalReceive(int timeout, TimeUnit unit) throws 
PulsarClientException {
+        Message<T> tMessage = null;
+
+        if (Objects.nonNull(conf.getReceiveThreads())){
+            messageScheduledFuture = Executors.newScheduledThreadPool(

Review comment:
       in this way, every call will create a new instance if we have this conf.




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