我对pub / sub使用rabbitmq
。我有两个微服务通过rabbitmq
交换相互通信。微服务1发布一些数据,微服务2消耗它。发布和订阅的速度非常低,每天100次。 rabbitmq
从客户端随机丢弃" Missed heartbeats,超时:30s"。
这就是为什么我的应用程序错误输出" 队列关闭"。每当我重新启动队列时,服务都能够使用它并开始工作。
我正在使用docker和node来进行微服务。 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": []
}
]
}
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
这是rabbitmq服务器的日志
{{1}}
答案 0 :(得分:0)
根据config docs和their heartbeats article,您可以尝试以下两种选择:
3600
(以秒为单位,等于1小时)