actumn / celery.node

Celery task queue client/worker for nodejs

Home Page:https://celery-node.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnhandledPromiseRejectionWarning error

Kainar01 opened this issue · comments

Description

  • What is the current behavior?
    After creating client and task, when task.applyAsync called, the UnhandledPromiseRejectionWarning error raises. It says "Error: connect ECONNREFUSED 127.0.0.1:5672", but my broker URL is pointing to cloudamqp instance.

  • What is the expected behavior?

In documentation, it is said that it should connect to broker_url, but it tries to connect to localhost on port 5672

  • Please tell us about your environment:

    • Version: Ubuntu 18.04
    • OS: linux
    • Language: Javascript
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

Hi!
Thank you for reporting the bug so clear.

But unfortunately, I couldn't reproduce the issue you described.
Can you share your codes that produce the problem?

@actumn I'm also getting this same issue (MacOS). I did not specify a backend url. Maybe if it is not specified it is defaulting to localhost? (127.0.0.1).

Here is a bit of the code I'm using:

const celery = require('celery-node');
const config = require('../config');
const debug = require('debug')('project:celery');


debug(config);
const client = celery.createClient(
    config.celeryBroker,
);

client.isReady().then(() => {
    debug('Connected to Celery successfully');
}).catch(error => console.log('Got an error', error))