SpringBoot集成Kafka版本不兼容导致出现错误

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://spring.io/projects/spring-kafka
参考:https://stackoverflow.com/questions/72402831/kafka-aborting-producer-batches-due-to-fatal-error

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值