To start the PoC you need to:
- start a Redis DB via docker-compose:
docker-compose up -d redis
Kue.js depends on a Redis database by default.
- run npm commands:
npm install
npm start
Then you can use your browser to "GET localhost:3000" navigating to http://localhost:3000. It is going to create job that a worker will process.
Check kue.js UI in http://localhost:3001 to view all jobs statuses.
To stop this PoC, run:
-
^CTRL+C
in your terminal to kill the app.js -
Stop Redis:
docker-compose stop redis
-
We are finishing Kue.js gracefully, so we must take care of that in our projects;
-
We can set the
title
parameter of Kue.js to a more meaningfull name using what we receive in the requesting; -
We can avoid exposing Kue.js UI in our apps, it can be made in an instance alone - security measures apply - since it is agnostic to any queue we create it will show all jobs from all queues.