You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Daniel Nuriyev (JIRA)" <ji...@apache.org> on 2017/03/23 14:40:41 UTC
[jira] [Commented] (SPARK-20036) impossible to read a whole kafka
topic using kafka 0.10 and spark 2.0.0
[ https://issues.apache.org/jira/browse/SPARK-20036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15938472#comment-15938472 ]
Daniel Nuriyev commented on SPARK-20036:
----------------------------------------
To provide more info I am attaching the pom.xml and the code with comments that i used to narrow down onto the issue.
Debugging lead me to KafkaUtils.fixKafkaParams that replaces "earliest" with "none":
https://github.com/apache/spark/blob/master/external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/KafkaUtils.scala
KafkaUtils.fixKafkaParams is called from the package private class DirectKafkaInputDStream.
I do not know if this is the reason.
The way to reproduce is to run the attached code against a topic that already has entries with offsets > 0. The problem is that no existing entries are read, only new entries are read.
I could consistently reproduce the problem.
The problem appeared when we upgraded the kafka client from 0.8 to 0.10.0
> impossible to read a whole kafka topic using kafka 0.10 and spark 2.0.0
> ------------------------------------------------------------------------
>
> Key: SPARK-20036
> URL: https://issues.apache.org/jira/browse/SPARK-20036
> Project: Spark
> Issue Type: Bug
> Components: Input/Output
> Affects Versions: 2.0.0
> Reporter: Daniel Nuriyev
> Attachments: Main.java, pom.xml
>
>
> I use kafka 0.10.1 and java code with the following dependencies:
> <dependency>
> <groupId>org.apache.kafka</groupId>
> <artifactId>kafka_2.11</artifactId>
> <version>0.10.1.1</version>
> </dependency>
> <dependency>
> <groupId>org.apache.kafka</groupId>
> <artifactId>kafka-clients</artifactId>
> <version>0.10.1.1</version>
> </dependency>
> <dependency>
> <groupId>org.apache.spark</groupId>
> <artifactId>spark-streaming_2.11</artifactId>
> <version>2.0.0</version>
> </dependency>
> <dependency>
> <groupId>org.apache.spark</groupId>
> <artifactId>spark-streaming-kafka-0-10_2.11</artifactId>
> <version>2.0.0</version>
> </dependency>
> The code tries to read the whole topic using:
> kafkaParams.put("auto.offset.reset", "earliest");
> Using 5 second batches:
> jssc = new JavaStreamingContext(conf, Durations.seconds(5));
> Each batch returns empty.
> I debugged the code I noticed that KafkaUtils.fixKafkaParams is called that overrides "earliest" with "none".
> Whether this is related or not, when I used kafka 0.8 on the client with kafka 0.10.1 on the server, I could read the whole topic.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org