pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] merlimat closed pull request #900: Fixed getting the position in PulsarKafkaConsumer when we don't have an offset yet
Date Thu, 01 Jan 1970 00:00:00 GMT
merlimat closed pull request #900: Fixed getting the position in PulsarKafkaConsumer when we
don't have an offset yet
URL: https://github.com/apache/incubator-pulsar/pull/900
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 6ece7fa0f..379bde4ce 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
@@ -456,7 +456,8 @@ public void seekToEnd(Collection<TopicPartition> partitions) {
 
     @Override
     public long position(TopicPartition partition) {
-        return lastReceivedOffset.get(partition);
+        Long offset = lastReceivedOffset.get(partition);
+        return offset != null ? offset : -1l;
     }
 
     @Override


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message