y9-node-redis-mq
v1.0.12
Published
y9-node-redis-mq
Downloads
5
Readme
const callback = async (data) =>{
const url = data.cb;
return request({
url: url,
method: 'POST',
json: true,
body: data
}, function(error, response, body) {
if (error) {
logger.info("回调失败.");
logger.info(error);
}
logger.info("回调返回内容:"+JSON.stringify(body));
return body;
});
}
// //地税服务(任务处理器)
MQ.on('taskProcessor',SzDsService.taskProcessor,{
threads:1,
callback
});
router.post("/taskProcessor", function(req, res, next) {
return MQ.emit('taskProcessor',req.body).then(function(response) {
res.send(response);
}, function(error) {
next(error);
});
});