admin管理员组文章数量:1134569
I am using kafka consumer which is up and running in my local. But when I add producer configs to post kafka message, its keep on disconnecting.
Below are the error logs
2025-01-07T18:36:42.133-08:00 INFO 70470 --- [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient : [Producer clientId=producer-1] Cancelled in-flight API_VERSIONS request with correlation id 85 due to node -6 being disconnected (elapsed time since creation: 27ms, elapsed time since send: 27ms, request timeout: 30000ms)
2025-01-07T18:36:42.133-08:00 WARN 70470 --- [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient : [Producer clientId=producer-1] Bootstrap broker aa.test:9092 (id: -6 rack: null) disconnected
2025-01-07T18:36:42.190-08:00 INFO 70470 --- [RMI TCP Connection(2)-127.0.0.1] o.a.k.clients.producer.KafkaProducer : [Producer clientId=producer-1] Closing the Kafka producer with timeoutMillis = 30000 ms.
Producer bean
@Bean
public ProducerFactory<String, String> enterpriseProducerFactory() throws IOException {
Map<String, Object> configProps = new HashMap<>();
configProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, aksBootStrapServers);
configProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
configProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
// Enterprise Kafka Config
configProps.put(SECURITY_PROTOCOL, securityProtocol);
configProps.put(SASL_MECHANISM, saslMechanism);
configProps.put(SSL_TRUSTSTORE_LOCATION, resourceFile.getFile().getAbsolutePath());
configProps.put(SSL_TRUSTSTORE_PASSWORD, trustStorePassword);
configProps.put(SASL_JAAS_CONFIG, saslJaasConfig);
return new DefaultKafkaProducerFactory<>(configProps);
}
The same setup is working in other spring boot microservice apps. Its just that this is happening in one of the apps where I am adding this new producer setup. Am I missing something basic? I enabled TRACE logging but didn't find anything useful to fix this issue.
本文标签: spring kafka producers disconnectingStack Overflow
版权声明:本文标题:spring kafka producers disconnecting - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736762496a1951626.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论