liukelin / canal_mysql_nosql_sync

基于canal 的 mysql 与 redis/memcached/mongodb 的 nosql 数据实时同步方案 案例 demo canal client
1.43k stars 470 forks source link

请问canal客户端会经常出现超时,大概是什么情况? #13

Open sentball opened 6 years ago

sentball commented 6 years ago
#=====canal client====================
#=====2016====================
#=====liukelin====================
#=====conf:/root/ali_canal_client/conf/canal.properties
#=====host:192.168.1.120:11111
#=====instance:example

connect success!
 startup...
java.util.concurrent.TimeoutException
        at com.rabbitmq.utility.BlockingCell.get(BlockingCell.java:76)
        at com.rabbitmq.utility.BlockingCell.uninterruptibleGet(BlockingCell.java:110)
        at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
        at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:366)
        at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:292)
        at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:824)
        at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:778)
        at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:868)
        at canal.client.rabbitmq.push_rabbitmq(rabbitmq.java:50)
        at canal.client.CanalClientTest.printEntry(CanalClientTest.java:315)
        at canal.client.CanalClientTest.main(CanalClientTest.java:242)
connection rabbitmq error!
connect error!
Exception in thread "main" java.lang.NullPointerException
        at canal.client.rabbitmq.push_rabbitmq(rabbitmq.java:56)
        at canal.client.CanalClientTest.printEntry(CanalClientTest.java:315)
        at canal.client.CanalClientTest.main(CanalClientTest.java:242)

如题,然后就退出了

liukelin commented 6 years ago

connection rabbitmq error! connect error!

查查你 rabbitmq 是否有连接问题

sentball commented 6 years ago

好的,canal client 与 rabbitmq 是长连接么?我看rabbitmq一直在 断开->连接 不断循环

=INFO REPORT==== 24-Apr-2018::14:47:48 ===
closing AMQP connection <0.31133.12> (127.0.0.1:37276 -> 127.0.0.1:5672)

=INFO REPORT==== 24-Apr-2018::14:47:49 ===
accepting AMQP connection <0.31146.12> (127.0.0.1:37280 -> 127.0.0.1:5672)

=INFO REPORT==== 24-Apr-2018::14:47:49 ===
closing AMQP connection <0.31146.12> (127.0.0.1:37280 -> 127.0.0.1:5672)

=INFO REPORT==== 24-Apr-2018::14:47:50 ===
accepting AMQP connection <0.31159.12> (127.0.0.1:37282 -> 127.0.0.1:5672)

=INFO REPORT==== 24-Apr-2018::14:47:50 ===
closing AMQP connection <0.31159.12> (127.0.0.1:37282 -> 127.0.0.1:5672)
liukelin commented 6 years ago

这个。。是我之前写法有问题,没复用连接造成的。 后面打包会改

liukelin commented 6 years ago

rabbitmq.java

liukelin commented 6 years ago

connection 全局创建就行