Could not get offset when using KafkaUtils.createDirectStream with Spark Streaming
Hi there, spark version: 1.6.0 scala: 2.10.4 EMR: 4.3.0
When I use KafkaUtils.createDirectStream with Spark Streaming to consumer data from Kafka, I could not see the consumer info from Kafka Manager.
Here is my setting code:
val kafkaParams = Map[String, String]("bootstrap.servers" -> brokers, "group.id" -> "ss-test1")
val topicsSet = topics.split(",").toSet
val instream = KafkaUtils.createDirectStream[String, String, StringDecoder, StringDecoder](ssc, kafkaParams, topicsSet)
Thanks!
DirectStream does not use ZooKeeper...
You're right! But Kafka Manager supports 0.9.0.0, it should be OK for us to get the consumer group offset of Kafka (new consumer).
Spark doesn't use the new consumer :) It saves the offsets in the checkpoint.
I recheck the DirectStream details, as you said it saves the offsets in the checkpoint. It also provide a way to update Zookeeper by myself, but I could not understand it. Any advice ?
You have to update ZooKeeper from code, check the HasOffetRange part in the official Spark Kafka documentation.
@shenzhun please close if this is no longer an issue.