首先声明,kafka集群(3台)部署,版本2.12-2.2.0
1.“Caused by: java.lang.ClassNotFoundException:org.springframework.messaging.Message”,需要引入spring-messaging-xxx.release.jar.
摘录pom如下:<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-messaging</artifactId>
</dependency>
2."Caused by: java.lang.ClassNotFoundException: org.springframework.transaction.support.ResourceTransactionManager", 需要引入spring-tx-xxx.release.jar
摘录pom如下:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
3.“Caused by: java.lang.ClassNotFoundException: org.springframework.retry.RetryListener”,需要引入spring-retry-xxx.release.jar
摘录pom如下:
<dependency>
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
</dependency>
4.producer发送消息,报warn:“Connection to node -n could not be established. Broker may not be available”,-n不定,
这种错误产生原因有好几处,我的问题出现在kafka配置文件中。修改kafka安装目录下config->server.properties, 释放listeners和advertised.listeners注释,修改ip。(两个属性值保持一致)
对于产生的问题会持续记录