You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2019/03/19 17:37:07 UTC

[pulsar] branch master updated: Fix the loop of consumer poll, so the consumer can cache more than one record in signal poll. (#3852)

This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new f1be6bd  Fix the loop of consumer poll, so the consumer can cache more than one record in signal poll. (#3852)
f1be6bd is described below

commit f1be6bda03151cca37db6b2f4286928fe3ace31e
Author: se7enkings <se...@users.noreply.github.com>
AuthorDate: Wed Mar 20 01:37:01 2019 +0800

    Fix the loop of consumer poll, so the consumer can cache more than one record in signal poll. (#3852)
---
 .../java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka/src/main/java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java b/pulsar-client-kafka-compat/pulsar-client-kafka/src/main/java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java
index 018ced2..5b3c53c 100644
--- a/pulsar-client-kafka-compat/pulsar-client-kafka/src/main/java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java
+++ b/pulsar-client-kafka-compat/pulsar-client-kafka/src/main/java/org/apache/kafka/clients/consumer/PulsarKafkaConsumer.java
@@ -354,7 +354,7 @@ public class PulsarKafkaConsumer<K, V> implements Consumer<K, V>, MessageListene
                 lastReceivedOffset.put(tp, offset);
                 unpolledPartitions.remove(tp);
 
-                if (++numberOfRecords < MAX_RECORDS_IN_SINGLE_POLL) {
+                if (++numberOfRecords >= MAX_RECORDS_IN_SINGLE_POLL) {
                     break;
                 }