已解决 canal 通过rabbitmq发送消息会丢数据
-
canal 部署版本:canal-1.1.5-SNAPSHOT
rabbitmq 版本:3.8.1,部署在虚拟机,8核8G问题描述:
1、canal 在运行一段时间后会报错,reply-code=320, reply-text=CONNECTION_FORCED
2、通过比对发现,新老数据库,丢了数据
3、Caused by: com.rabbitmq.client.AlreadyClosedException: connection is already closed due to connection error; protocol method: #method<connection.close>(reply-code=320, reply-text=CONNECTION_FORCED - broker forced connection closure with reason ‘shutdown’, class-id=0, method-id=0)
at com.rabbitmq.client.impl.AMQChannel.ensureIsOpen(AMQChannel.java:257) ~[na:na]
at com.rabbitmq.client.impl.AMQChannel.transmit(AMQChannel.java:426) ~[na:na]
at com.rabbitmq.client.impl.ChannelN.basicPublish(ChannelN.java:704) ~[na:na]
at com.rabbitmq.client.impl.ChannelN.basicPublish(ChannelN.java:679) ~[na:na]
at com.rabbitmq.client.impl.ChannelN.basicPublish(ChannelN.java:669) ~[na:na] -
已经私聊做过一些沟通,根据用户反馈的日志信息,怀疑是rabbitmq server重启导致,日志时间匹配。rabbitmq client有个配置AutomaticRecoveryEnabled可以设置下,断连可以自动恢复连接的