Jonny
Jonny

Reputation: 2917

Cannot connect to any rabbitmq cloud service

I was working fine with cloudamqp until all of a sudden wascally/rabbot stopped being able to connect to my endpoint. I have installed RabbitMQ locally and my system works fine. I have since then tried to setup a RabbitMq instance on Heroku via bigwig, to no avail. The endpoints I'm using should be fine and I also installed amqp.node and node-amqp to test if maybe it was a problem with rabbot. However none of these can connect either.

Any idea what the problem can be?

Upvotes: 1

Views: 1411

Answers (1)

Derick Bailey
Derick Bailey

Reputation: 72858

the most common cause is connection timeout. with all my wascally code, hosting on cloudamqp (with heroku, digital ocean or otherwise), i have to set a connection timeout much higher than the default for it to work.

this can be done with the connection_timeout parameter on the connection string url (https://www.rabbitmq.com/uri-query-parameters.html)

for example:

var conn = "amqp://myuser:[email protected]/my-vhost?connection_timeout=30"

this will set a connection timeout of 30 seconds

Upvotes: 1

Related Questions