2014년 12월 7일 일요일

Job queue for Node.js

Does anyone knows a good job queue that has atomicity and scheduled jobs?



I have used Agenda which is backed with MongoDB. That has served my purpose.

There is also an AgendaUI package where you can view all the status of the jobs which have been schsduled

Reference:



It is very nice, but it doesn't seem to delegate the job processing to other servers, or am I wrong?



Does anyone knows a good job queue that has atomicity and scheduled jobs?


You'd have to use `setInterval` for scheduling.



Andrew, is your implementation atomic?



Andrew, is your implementation atomic?

Yes. Lua scripts are used to do atomic operations on redis. 






Does anyone knows a good job queue that has atomicity and scheduled jobs?
Atomicity of what?

It may be that you want to break out these functions: if you make your tasks idempotent, you become resilient to all kinds of failures of your job queue -- and in fact can use one that's very fast and limited like Gearman.

You can use cron for scheduling -- or just a simple daemon that looks up the next time to run something and stuffs it in the queue then.

What guarantees do you need from your queue vs the jobs you schedule on it? Why?




I use RabbitMQ with a max length of 1 to ensure that only one of my nodejs node catches the job and executes it.
But I use setInterval to launch them.
The advantage is that you can remotely send a message through the queue to force a node executing your callback task and with any langage supporting the amqp (this can even be done with the rabbit management UI).



At my former employer we created a Job Queue (to replace Kue) for our needs: 


It's essentially a REST API on top of MongoDB, with support for web hooks.

MongoDB does has document-level atomicity, see here: http://docs.mongodb.org/manual/tutorial/model-data-for-atomic-operations/

It doesn't have scheduled jobs. If you wanted that feature, you may be better off looking at other systems. Otherwise, if you're upto it, you could fork it and add it in.



At my former employer we created a Job Queue (to replace Kue) for our needs: 
Kue has fixed some serious atomicity problems ​it had a year ago, and is planned to move into a fully atomic (server side LUA based redis) state management from 1.0

May I ask what was your actual problems with it?



댓글 없음:

댓글 쓰기