Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of Celery in Node JS

Tags:

Please suggest an equivalent of Celery in Node JS to run asynchronous tasks. I have been able to search for the following:

  1. (Later)
  2. Kue (Kue),
  3. coffee-resque (coffee-resque)
  4. cron (cron)
  5. node-celery(node celery)

I have run both manual and automated threads in background and interact with MongoDB.

node-celery is using redis DB and not Mongo DB. Is there any way I can change that?When I installed node-celery redis was installed as dependency.

I am new to celery, Please guide.Thanks.

like image 620
garima Avatar asked Feb 12 '15 06:02

garima


People also ask

What is celery node?

A Node is just a Worker in a Cluster. In short Node = Worker. A Cluster is a number of Workers running in parallel (using celery multi as per the document I introduced with). A Cluster is just a convenient way of starting and stopping and managing multiple workers on the same machine.

What is the difference between celery and RabbitMQ?

Celery: Distributed task queue. Celery is an asynchronous task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports scheduling as well; RabbitMQ: A messaging broker - an intermediary for messaging.

What is BullMQ?

BullMQ is a Node. js library that implements a fast and robust queue system built on top of Redis that helps in resolving many modern age micro-services architectures.

What is celery broker and backend?

Celery has the ability to communicate and store with many different backends (Result Stores) and brokers (Message Transports).


2 Answers

Celery is basically a RabbitMQ client. There are producers (tasks), consumers (workers) and AMQP message broker which delivers messages between tasks and workers.

Knowing that will enable you to write your own celery in node.js.

enter image description here

node-celery here is a library that enables your node process to work both as a celery client (Producer/Publisher) and a celery worker (Consumer).

See https://abhishek-tiwari.com/post/amqp-rabbitmq-and-celery-a-visual-guide-for-dummies

like image 103
Vanuan Avatar answered Sep 23 '22 14:09

Vanuan


Go for Kue, it's a wholistic solution that resembles Celery in Python word; it has the concepts of: producers/consumers, delayed tasks, task retrial, task TTL, ability to round-robin tasks across multiple consumers listening to the same queue, etc.

Probably Celery is more advanced with more features with more brokers to support and you can use node-celery if you like, but, in my opinion, I think no need to go for a hybrid solution that requires installation of python and node when you can only use only language that's sufficient in 90% of the cases (unless necessary of course).

––––––––––––––––––––––––––––––––––––––––

Edit-1/2018

My recommendation is not to use Kue now, as it seems to be a stalled project, use Celery instead. It is very well supported and maintained by the community and supports large number of use cases.

like image 25
securecurve Avatar answered Sep 24 '22 14:09

securecurve