Reputation: 383
I am using rabbitmq
for pub/sub. I have two micro-services which communicates each other through rabbitmq
exchange. micro service1 publishes some data and micro service2 consumes it. The rate of publishing and subscribing is very less, its like 100 times a day. rabbitmq
randomly throwing the "Missed heartbeats from the client, timeout: 30s".
That's why my application error outs as "queue shutdown". Whenever I restart queue, services able to use it and starts working.
I am using docker and node for microservices. and https://www.npmjs.com/package/rabbot npm package for rabbitmq
implementation.
This is my 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": []
}
]
}
Here is the log of rabbitmq server
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
Upvotes: 10
Views: 15922
Reputation: 1049
According to the config docs and their heartbeats article you have two options to try:
3600
(in seconds, which equals to 1 hour)Upvotes: 4