ttamqp
Cài module:
$ npm install --save @lib/ttamqp
Sử dụng module
;
Queue
; /////////////////////// Nhận job và xử lývar workerManager = url: 'amqp://username:password@10.3.31.222/vhost'; const handle = { // params là data được gửi đến // todo ... // sau khi xử lý xong thì callback lại. // thành công: callback(null) // có lỗi: callback(error). Khi có lỗi thì job sẽ được push ngược vào queue để xử lý lại ;}; // jobhandler chính là tên queueworkerManager; ////////////////////// push job tới queuevar publisher = url: 'amqp://username:password@10.3.31.222/vhost'; publisher;