gpt4 book ai didi

apache-kafka - spark-streaming-kafka-0-10 auto.offset.reset 总是设置为 none

转载 作者:行者123 更新时间:2023-12-04 04:12:41 31 4
gpt4 key购买 nike

有没有人在 spark-streaming-kafka 0-10 中分配 auto.offset.reset->"latest"不影响此属性时遇到此问题

这是我的代码:

 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))

但是当我部署时,我得到了这个结果
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

你能帮忙吗?
谢谢

最佳答案

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

关于apache-kafka - spark-streaming-kafka-0-10 auto.offset.reset 总是设置为 none,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40546883/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com