我用rabbitmq
做酒吧/潜艇。我有两个微服务,通过rabbitmq
交换彼此通信.微service1发布一些数据,而微service2则使用它。出版和订阅率非常低,每天大约100次。rabbitmq
随机抛出“客户端错过的心跳,超时:30”。这就是我的应用程序错误作为“队列关闭”的原因。每当我重新启动队列时,服务就能够使用它并开始工作。
我正在使用码头和节点进行微服务。以及用于实现https://www.npmjs.com/package/rabbot rabbitmq
的npm包。
这是我的rabbitmq config
{
"connection": {
"server": [
"rabbitmq"
],
"port": 5672,
"vhost": "%2f",
"timeout": 4000,
"waitMin": 10000,
"waitIncrement": 3000
},
"exchanges": [
{
"name": "save-customer",
"type": "topic",
"persistent": true,
"autoDelete": true
},
{
"name": "poison-ex",
"type": "direct",
"persistent": true,
"durable": true,
"autoDelete": true
}
],
"queues": [
{
"name": "save-customer-q",
"autoDelete": true,
"subscribe": true,
"deadLetter": "poison-ex"
},
{
"name": "poison-q",
"noAck": false,
"autoDelete": false,
"durable": true,
"poison": true
}
],
"bindings": [
{
"exchange": "save-customer",
"target": "save-customer-q",
"keys": [
"send-customer-data"
]
},
{
"exchange": "poison-ex",
"target": "poison-q",
"keys": []
}
]
}
以下是rabbitmq服务器的日志
root@ALIPL5126:/opt/hos-customer-service# docker logs opt_rabbitmq_1
2018-05-31 07:09:25.438 [warning] <0.26747.0> closing AMQP connection <0.26747.0> (192.168.16.5:45180 -> 192.168.16.2:5672):
missed heartbeats from client, timeout: 30s
https://stackoverflow.com/questions/50619784
复制相似问题