Commit b9920929 by 宋毅

tj

parent 3dc9c04b
......@@ -16,7 +16,7 @@ class APIBase {
var result = await this[methodname](pobj, query, req);
pobj.actionBody.resultInfo = result;
pobj.actionBody.requestId = result.requestId;
this.esUtils.addEsLogs(settings.queuedName + "apidoexec-info", pobj.actionBody);
this.esUtils.addEsLogs(settings.queuedName + "api-doexecmethod-info", pobj.actionBody);
return result;
} catch (e) {
console.log(e.stack, "api.base调用出现异常,请联系管理员..........");
......
......@@ -51,20 +51,24 @@ class ConsumerBase {
actionBody.requestId = await this.getBusUid("PUB-");
if (queuedName.indexOf("SYTXFAIL-SYTXPUBLIC-MSGQ") < 0) {
execResult = await this.subDoConsumer(queuedName, actionBody);
console.log(execResult, "..........................................11......");
if (execResult.status === 1) {
var notifyQueuedName = "NOTIFY-SYTXPUBLIC-MSGQ";
if (queuedName.indexOf(notifyQueuedName) < 0) {
if (actionBody.notifyUrl && actionBody.notifyUrl.indexOf("http") > 0) {
actionBody.resultInfo = execResult;
console.log(actionBody, "..............................22.......");
await this.redisClient.lpushData(notifyQueuedName, actionBody);
}
}
console.log(actionBody, "........................................33.......");
await this.pushSuccessLogDao.addOpSuccessLogs("推送成功", actionBody, execResult);
return;
}
var failQueuedName = "SYTXFAIL-SYTXPUBLIC-MSGQ";
actionBody.queuedName = queuedName;
actionBody.counter = actionBody.counter ? actionBody.counter + 1 : 1;
console.log(actionBody, "...........................................44.......");
await this.redisClient.lpushData(failQueuedName, actionBody);
return;
}
......
......@@ -108,7 +108,7 @@ class RedisClient {
messageBody = typeof messageBody === 'object' ? JSON.stringify(messageBody) : messageBody;
this.client.lpush(queuedName, messageBody, function (err, reply) {
if (err) {
console.log('lpush message error :' + err);
console.log('lpush message error :' + err + ",queuedName:" + queuedName + ",messageBody:" + messageBody);
return new Error('lpush message error :' + err);
} else {
console.log('lpush message success');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment