gpt4 book ai didi

apache-kafka - 为什么我不能增加 session.timeout.ms?

转载 作者:行者123 更新时间:2023-12-03 23:17:10 27 4
gpt4 key购买 nike

我要加session.timeout.ms允许更长的时间来处理 poll() 之间收到的消息来电。但是,当我更改 session.timeout.ms到高于 30000 的值,它无法创建 Consumer 对象并抛出以下错误。

谁能告诉我为什么我不能增加session.timeout.ms值(value)还是我遗漏了什么?

0    [main] INFO  org.apache.kafka.clients.consumer.ConsumerConfig  - ConsumerConfig values: 

request.timeout.ms = 40000
check.crcs = true
retry.backoff.ms = 100
ssl.truststore.password = null
ssl.keymanager.algorithm = SunX509
receive.buffer.bytes = 262144
ssl.cipher.suites = null
ssl.key.password = null
sasl.kerberos.ticket.renew.jitter = 0.05
ssl.provider = null
sasl.kerberos.service.name = null
session.timeout.ms = 40000
sasl.kerberos.ticket.renew.window.factor = 0.8
bootstrap.servers = [server-name:9092]
client.id =
fetch.max.wait.ms = 500
fetch.min.bytes = 50000
key.deserializer = class org.apache.kafka.common.serialization.StringDeserializer
sasl.kerberos.kinit.cmd = /usr/bin/kinit
auto.offset.reset = latest
value.deserializer = class org.apache.kafka.common.serialization.StringDeserializer
ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
partition.assignment.strategy = [org.apache.kafka.clients.consumer.RangeAssignor]
ssl.endpoint.identification.algorithm = null
max.partition.fetch.bytes = 2097152
ssl.keystore.location = null
ssl.truststore.location = null
ssl.keystore.password = null
metrics.sample.window.ms = 30000
metadata.max.age.ms = 300000
security.protocol = PLAINTEXT
auto.commit.interval.ms = 5000
ssl.protocol = TLS
sasl.kerberos.min.time.before.relogin = 60000
connections.max.idle.ms = 540000
ssl.trustmanager.algorithm = PKIX
group.id = test7
enable.auto.commit = false
metric.reporters = []
ssl.truststore.type = JKS
send.buffer.bytes = 131072
reconnect.backoff.ms = 50
metrics.num.samples = 2
ssl.keystore.type = JKS
heartbeat.interval.ms = 3000

Exception in thread "main" org.apache.kafka.common.KafkaException: Failed to construct kafka consumer at org.apache.kafka.clients.consumer.KafkaConsumer.(KafkaConsumer.java:624) at org.apache.kafka.clients.consumer.KafkaConsumer.(KafkaConsumer.java:518) at org.apache.kafka.clients.consumer.KafkaConsumer.(KafkaConsumer.java:500)

最佳答案

更改 session.timeout.ms 需要牢记这些条件:

  • group.max.session.timeout.ms在 server.properties > session.timeout.ms在 consumer.properties 中。
  • group.min.session.timeout.ms在 server.properties < session.timeout.ms在 consumer.properties 中。
  • request.timeout.ms > session.timeout.ms + fetch.wait.max.ms
  • ( session.timeout.ms )/3 > heartbeat.interval.ms
  • session.timeout.ms > 每个消费者轮询的消费者记录的最坏情况处理时间(毫秒)。
  • 关于apache-kafka - 为什么我不能增加 session.timeout.ms?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38406298/

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