环境: spring-boot.version - 1.5.9.RELEASE spring-kafka.version - 1.2.0.RELEASE Kafka实例的客户端lib版本 - kafka-clients-0.10.2.0.jar
在Kafka spring应用程序中,无法从生产者向kafka实例发送任何消息
org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s)
for testtopicname-0: 60018 ms has passed since last append
我也增加了超时属性,但这并没有帮助
很少有制作人配置道具:
props.put(ProducerConfig.REQUEST_TIMEOUT_MS_CONFIG, 60000);
props.put(ProducerConfig.RETRIES_CONFIG, 3);
props.put(ProducerConfig.BATCH_SIZE_CONFIG, 1);
props.put(ProducerConfig.LINGER_MS_CONFIG, 5);
发送消息的代码快照:
kafkaTemplate.send(message)
以下是SSL特定配置
Kafka Instance :
ssl.cipher.suites = null
ssl.client.auth = none
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
Spring producer :
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