kafka的producer遇到这个问题:Closing the Kafka producer with timeoutMillis = 0 ms

Andrew Li 发表于: 2018-06-06   最后更新时间: 2018-06-07  
  •   0 订阅,173 游览

这是我的producer配置:

acks = 1
batch.size = 16384
bootstrap.servers = [192.168.10.10:9092]
buffer.memory = 33554432
client.id =
compression.type = none
connections.max.idle.ms = 540000
enable.idempotence = false
interceptor.classes = null
key.serializer = class org.apache.kafka.common.serialization.StringSerializer
linger.ms = 1
max.block.ms = 60000
max.in.flight.requests.per.connection = 5
max.request.size = 1048576
metadata.max.age.ms = 300000
metric.reporters = []
metrics.num.samples = 2
metrics.recording.level = INFO
metrics.sample.window.ms = 30000
partitioner.class = class org.apache.kafka.clients.producer.internals.DefaultPartitioner
receive.buffer.bytes = 32768
reconnect.backoff.max.ms = 1000
reconnect.backoff.ms = 50
request.timeout.ms = 30000
retries = 1
retry.backoff.ms = 100
sasl.jaas.config = null
sasl.kerberos.kinit.cmd = /usr/bin/kinit
sasl.kerberos.min.time.before.relogin = 60000
sasl.kerberos.service.name = null
sasl.kerberos.ticket.renew.jitter = 0.05
sasl.kerberos.ticket.renew.window.factor = 0.8
sasl.mechanism = GSSAPI
security.protocol = PLAINTEXT
send.buffer.bytes = 131072
ssl.cipher.suites = null
ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
ssl.endpoint.identification.algorithm = null
ssl.key.password = null
ssl.keymanager.algorithm = SunX509
ssl.keystore.location = null
ssl.keystore.password = null
ssl.keystore.type = JKS
ssl.protocol = TLS
ssl.provider = null
ssl.secure.random.implementation = null
ssl.trustmanager.algorithm = PKIX
ssl.truststore.location = null
ssl.truststore.password = null
ssl.truststore.type = JKS
transaction.timeout.ms = 60000
transactional.id = null
value.serializer = class org.apache.kafka.common.serialization.StringSerializer






发表于: 1月前   最后更新时间: 1月前   游览量:173
上一条: 到头了!
下一条: 已经是最后了!

评论…


  • 提供下完整的错误额。
    • 已经解决了,我是使用spring的kafka模版发送消息的,每次都新建了一个producer,没有使用到单例创建producer,导致kafka报了异常,阻止新的producer继续创建。kafka抛异常的源码:
      private KafkaProducer(ProducerConfig config, Serializer<K> keySerializer, Serializer<V> valueSerializer) {
      try{
          log.trace("Starting the Kafka producer");
          ....
      } catch (Throwable t) {
                  // call close methods if internal objects are already constructed this is to prevent resource leak. see KAFKA-2121
                  close(0, TimeUnit.MILLISECONDS, true);
                  // now propagate the exception
                  throw new KafkaException("Failed to construct kafka producer", t);
      }
      • 评论…
        • in this conversation
          提问