简体   繁体   English

spark-streaming-kafka-0-10 auto.offset.reset 始终设置为 none

[英]spark-streaming-kafka-0-10 auto.offset.reset is always set to none

Does anyone come across the issue when assign auto.offset.reset->"latest" doesn't affect this property in spark-streaming-kafka 0-10当分配 auto.offset.reset->"latest" 不影响 spark-streaming-kafka 0-10 中的此属性时,是否有人遇到过此问题

here is my code:这是我的代码:

 val config = StreamingConfigHelper.getStreamingConfig()
val kafkaParams = Map[String, Object]("bootstrap.servers" -> config.brokers,
  "key.deserializer" -> classOf[ByteArrayDeserializer],
  "value.deserializer" -> classOf[ByteArrayDeserializer],
  "group.id" -> "prodgroup",
  "auto.offset.reset" -> "latest",
  "receive.buffer.bytes" -> (65536: java.lang.Integer),
  "enable.auto.commit" -> (false: java.lang.Boolean))
val inputDStream = KafkaUtils.createDirectStream[Array[Byte], Array[Byte]](streamingContext, LocationStrategies.PreferConsistent,
  ConsumerStrategies.Subscribe[Array[Byte], Array[Byte]](config.productTopic.toArray, kafkaParams))

But when I deploy I get this results但是当我部署时,我得到了这个结果

16/11/11 11:03:00 INFO ConsumerConfig: ConsumerConfig values: 
metric.reporters = []
metadata.max.age.ms = 300000
partition.assignment.strategy = [org.apache.kafka.clients.consumer.RangeAssignor]
reconnect.backoff.ms = 50
sasl.kerberos.ticket.renew.window.factor = 0.8
max.partition.fetch.bytes = 1048576
bootstrap.servers = [xxxxxxxxx:6667, xxxxxxxx:6667, xxxxxxxxxx:6667]
ssl.keystore.type = JKS
enable.auto.commit = false
sasl.mechanism = GSSAPI
interceptor.classes = null
exclude.internal.topics = true
ssl.truststore.password = null
client.id = 
ssl.endpoint.identification.algorithm = null
max.poll.records = 2147483647
check.crcs = true
request.timeout.ms = 40000
heartbeat.interval.ms = 3000
auto.commit.interval.ms = 5000
receive.buffer.bytes = 65536
ssl.truststore.type = JKS
ssl.truststore.location = null
ssl.keystore.password = null
fetch.min.bytes = 1
send.buffer.bytes = 131072
value.deserializer = class org.apache.kafka.common.serialization.ByteArrayDeserializer
group.id = spark-executor-prodgroup1
retry.backoff.ms = 100
sasl.kerberos.kinit.cmd = /usr/bin/kinit
sasl.kerberos.service.name = null
sasl.kerberos.ticket.renew.jitter = 0.05
ssl.trustmanager.algorithm = PKIX
ssl.key.password = null
fetch.max.wait.ms = 500
sasl.kerberos.min.time.before.relogin = 60000
connections.max.idle.ms = 540000
session.timeout.ms = 30000
metrics.num.samples = 2
key.deserializer = class org.apache.kafka.common.serialization.ByteArrayDeserializer
ssl.protocol = TLS
ssl.provider = null
ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
ssl.keystore.location = null
ssl.cipher.suites = null
security.protocol = PLAINTEXT
ssl.keymanager.algorithm = SunX509
metrics.sample.window.ms = 30000
auto.offset.reset = none

Could you help please?你能帮忙吗? Thanks谢谢

i am not sure why the setting is ignored but you could also try not to set the auto.offset.reset because the default is "latest" in the new consumer configs. 我不确定为什么忽略该设置,但你也可以尝试不设置auto.offset.reset,因为新的消费者配置中的默认值是“最新的”。 Source of information: https://kafka.apache.org/documentation#newconsumerconfigs 信息来源: https//kafka.apache.org/documentation#newconsumerconfigs

您的设置在KafkaUtils.fixKafkaParams中被覆盖:我不知道为什么......

@jpsjph 如果我们尽量不设置 auto.offset.reset,这个问题就解决了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用rest api设置kafka connect auto.offset.reset - how to set kafka connect auto.offset.reset with rest api spark-streaming-kafka-0-8和spark-streaming-kafka-0-10 - spark-streaming-kafka-0-8 vs spark-streaming-kafka-0-10 Spark Streaming 不支持 auto.offset.reset="smallest" 或 group.id? - Spark Streaming not honoring auto.offset.reset=“smallest” or group.id? spark-streaming-kafka-0-10:如何限制Spark分区的数量 - spark-streaming-kafka-0-10: How to limit number of Spark partitions pyspark是否支持spark-streaming-kafka-0-10 lib? - does pyspark support spark-streaming-kafka-0-10 lib? 使用选项kafka.bootstrap.servers不消耗spark-streaming-kafka-0-10的任何消息 - Consume no message from spark-streaming-kafka-0-10 with option kafka.bootstrap.servers 卡卡auto.offset.reset查询 - Kaka auto.offset.reset query 不清楚Kafka中auto.offset.reset和enable.auto.commit的含义 - Not clear about the meaning of auto.offset.reset and enable.auto.commit in Kafka Kafka Consumer配置——auto.offset.reset如何控制消息消费 - Kafka Consumer configuration - How does auto.offset.reset controls the message consumption 如果 auto.offset.reset=earliest 但主题没有消息,将设置什么消费者偏移量 - What consumer offset will be set if auto.offset.reset=earliest but topic has no messages
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM