org.apache.kafka.common.KafkaException: Failed to construct kafka producer

java.lang.ExceptionInInitializerError
Caused by: org.apache.kafka.common.KafkaException: Failed to construct kafka producer
    at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:431)
    at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:301)
    at io.nonda.amazon.util.kafka.ProducerDemo.(ProducerDemo.java:25)
Caused by: org.apache.kafka.common.config.ConfigException: delivery.timeout.ms should be equal to or larger than linger.ms + request.timeout.ms
    at org.apache.kafka.clients.producer.KafkaProducer.configureDeliveryTimeout(KafkaProducer.java:485)
    at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:394)
    ... 2 more

 

org.apache.kafka.common.KafkaException: Failed to construct kafka producer_第1张图片

设置的delivery.timeout.ms值应该大于等于linger.ms + request.timeout.ms,我的request.timeout.ms和linger.ms,如下:

此处将delivery.timeout.ms设置30001,或者去掉这个设置,就可以

你可能感兴趣的:(kafka)