rascal: Connection retry doesn't always work after RabbitMQ is killed and restarted
Or more accurately most times it doesn’t work.
Below is the broker config:
module.exports = {
vhosts: {
[config.RABBITMQ_VHOST]: {
connection: {
url: `${config.RABBITMQ_CONNECTION_STRING}`
},
exchanges: {
[config.RABBITMQ_EXCHANGE_ENDPOINT_OUT]: {
type: "topic",
assert: false,
check: true
}
},
publications: {
connectorPub: {
exchange: `${config.RABBITMQ_EXCHANGE_ENDPOINT_OUT}`,
routingKey: `${config.RABBITMQ_PUBLISH_ROUTING_KEY}`
}
}
}
}
};
I have 3 issues:
- Rascal doesn’t retry to connection if RabbitMQ has not been started (Rascal is started earlier than RabbitMQ). We mitigate this issue by exiting and let Kubernetes to restart the pods. Eventually Rascal will connect after RabbitMQ is started.
- After Rascal is connected to RabbitMQ, kill and restart RabbitMQ. Sometimes it will retry to connect, but most times it won’t. Connection reset error is provided though, but no retry. {“message”:“Broker error: Error: write ECONNRESET; vhost: /; connectionUrl: amqp://guest:***@localhost:31072”,“level”:“error”}
- If RabbitMQ is killed twice, Rascal will just give up. No retry has been observed.
I’m using the default retry configuration and I hope it should work as assumed. Please let me know whether this is a configuration issue or a bug.
Thanks.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 25
Found the problem:
vhost_initializedshould bevhost_initialised. My bad, or spelling checker’s fault.It all works as I expected now. Please close the ticket. Thanks a lot for the great library and your time on this issue.