简体   繁体   中英

How to use node.js for a queue processing app

将node.js用于队列处理应用程序时的最佳实践是什么?

My main concern there would be that Node processes can handle thousands of items at once, but that a rogue unhandled error in any of them could bring down the whole process.

I'd be looking for a queue/driver combination that allowed a two-phase commit (wrong terminology I think?), ie:

  1. Get the next appropriate item from the queue (which then blocks that item from being consumed elsewhere)
  2. Once each item is handed over to the downstream service/database/filesystem you can then tell the queue that the item has been processed

I'd also want repeatably unique identifiers so that you can reliably detect if an item comes down the pipe twice. In a theoretical system it might not happen, but in a practical environment the capability to deal with it will make your life easier.

查看http://learnboost.github.com/kue/我已经将其用于几个宠物项目,并且效果很好,您可以查看其来源并检查他们采取了哪些措施

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM