I'm able to use cloudamqp documentation to connect using Nodejs client as shown in sample code on cloudaqmp's website, but I can't seem to do so using celery in my nodejs application on Heroku. Here is the snippet I'm using to connect in my application where I have defined my CLOUDAMQP_URL variable:
var celery = require('node-celery'),
client = celery.createClient({
CELERY_BROKER_URL: (process.env.CLOUDAMQP_URL || 'amqp://guest:guest@localhost:5672//'),
CELERY_RESULT_BACKEND: 'amqp',
BROKER_POOL_LIMIT: 1, //Will decrease connection usage
BROKER_CONNECTION_TIMEOUT: 300, //# May require a long timeout due to Linux DNS timeouts etc
CELERY_SEND_EVENTS: true
});
client.on('error', function(err) {
console.log("Cannot connect to CLOUDAMQP using celery");
console.log(err);
});
I am throwing an error in the client.on('error') callback. The error is nondescriptive: Cannot connect to CLOUDAMQP using celery
{ [Error: read ECONNRESET] code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }
How should I debug this? I could not find an example of how to do this. FYI I have checked that the above syntax works for a local amqp queue (i.e it works on my machine for amqp://guest:guest@localhost:5672//)