rdhabalia commented on a change in pull request #942: Bugfix: duplicate 
messages for PartitionedConsumers.
URL: https://github.com/apache/incubator-pulsar/pull/942#discussion_r155378128
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PartitionedConsumerImpl.java
 ##########
 @@ -191,7 +200,9 @@ protected Message internalReceive(int timeout, TimeUnit 
unit) throws PulsarClien
         Message message;
         try {
             lock.writeLock().lock();
-            message = incomingMessages.poll(0, TimeUnit.SECONDS);
+            message = (incomingMessages.size() > 0) ?
+                    incomingMessages.poll(0, TimeUnit.SECONDS) : 
messageFromConsumerImpl();
 
 Review comment:
   I think it will not be necessary because it does the similar thing at 
line#209 by calling `resumeReceivingFromPausedConsumersIfNeeded()`. So, if 
queue is empty then `resumeReceivingFromPausedConsumersIfNeeded()` try to 
receive message from next consumer which has message available in the queue. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to