1、系统报错
[kafka-producer-network-thread | producer-1] [] [] ERROR org.apache.kafka.clients.producer.internals.Sender - [Producer clientId=producer-1] Aborting producer batches due to fatal error
org.apache.kafka.common.KafkaException: Unexpected error in InitProducerIdResponse; The server experienced an unexpected error when processing the request.
at org.apache.kafka.clients.producer.internals.TransactionManager$InitProducerIdHandler.handleResponse(TransactionManager.java:1390)
at org.apache.kafka.clients.producer.internals.TransactionManager$TxnRequestHandler.onComplete(TransactionManager.java:1294)
at org.apache.kafka.clients.ClientResponse.onComplete(ClientResponse.java:109)
at org.apache.kafka.clients.NetworkClient.completeResponses(NetworkClient.java:574)
at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:566)
at org.apache.kafka.clients.producer.internals.Sender.maybeSendAndPollTransactionalRequest(Sender.java:418)
at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:316)
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:243)
at java.lang.Thread.run(Thread.java:748)
[kafka-producer-network-thread | producer-1] [] [] ERROR o.s.kafka.support.LoggingProducerListener - Exception thrown when sending a message with key='null' and
2、排查与解决
出错原因:springboot集成spring-kafka的时候需要注意两者之间的版本对应关系,因为版本不兼容导致出现错误
解决:kafka-clients : 是springboot集成的spring-kafka,spring-kafka中引入了kafka-client的版本文章来源:https://www.toymoban.com/news/detail-626739.html
参考:https://spring.io/projects/spring-kafka
参考:https://stackoverflow.com/questions/72402831/kafka-aborting-producer-batches-due-to-fatal-error文章来源地址https://www.toymoban.com/news/detail-626739.html
到了这里,关于SpringBoot集成Kafka版本不兼容导致出现错误的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!