Commit b9920929 by 宋毅

tj

parent 3dc9c04b
...@@ -16,7 +16,7 @@ class APIBase { ...@@ -16,7 +16,7 @@ class APIBase {
var result = await this[methodname](pobj, query, req); var result = await this[methodname](pobj, query, req);
pobj.actionBody.resultInfo = result; pobj.actionBody.resultInfo = result;
pobj.actionBody.requestId = result.requestId; 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; return result;
} catch (e) { } catch (e) {
console.log(e.stack, "api.base调用出现异常,请联系管理员.........."); console.log(e.stack, "api.base调用出现异常,请联系管理员..........");
......
...@@ -51,20 +51,24 @@ class ConsumerBase { ...@@ -51,20 +51,24 @@ class ConsumerBase {
actionBody.requestId = await this.getBusUid("PUB-"); actionBody.requestId = await this.getBusUid("PUB-");
if (queuedName.indexOf("SYTXFAIL-SYTXPUBLIC-MSGQ") < 0) { if (queuedName.indexOf("SYTXFAIL-SYTXPUBLIC-MSGQ") < 0) {
execResult = await this.subDoConsumer(queuedName, actionBody); execResult = await this.subDoConsumer(queuedName, actionBody);
console.log(execResult, "..........................................11......");
if (execResult.status === 1) { if (execResult.status === 1) {
var notifyQueuedName = "NOTIFY-SYTXPUBLIC-MSGQ"; var notifyQueuedName = "NOTIFY-SYTXPUBLIC-MSGQ";
if (queuedName.indexOf(notifyQueuedName) < 0) { if (queuedName.indexOf(notifyQueuedName) < 0) {
if (actionBody.notifyUrl && actionBody.notifyUrl.indexOf("http") > 0) { if (actionBody.notifyUrl && actionBody.notifyUrl.indexOf("http") > 0) {
actionBody.resultInfo = execResult; actionBody.resultInfo = execResult;
console.log(actionBody, "..............................22.......");
await this.redisClient.lpushData(notifyQueuedName, actionBody); await this.redisClient.lpushData(notifyQueuedName, actionBody);
} }
} }
console.log(actionBody, "........................................33.......");
await this.pushSuccessLogDao.addOpSuccessLogs("推送成功", actionBody, execResult); await this.pushSuccessLogDao.addOpSuccessLogs("推送成功", actionBody, execResult);
return; return;
} }
var failQueuedName = "SYTXFAIL-SYTXPUBLIC-MSGQ"; var failQueuedName = "SYTXFAIL-SYTXPUBLIC-MSGQ";
actionBody.queuedName = queuedName; actionBody.queuedName = queuedName;
actionBody.counter = actionBody.counter ? actionBody.counter + 1 : 1; actionBody.counter = actionBody.counter ? actionBody.counter + 1 : 1;
console.log(actionBody, "...........................................44.......");
await this.redisClient.lpushData(failQueuedName, actionBody); await this.redisClient.lpushData(failQueuedName, actionBody);
return; return;
} }
......
...@@ -108,7 +108,7 @@ class RedisClient { ...@@ -108,7 +108,7 @@ class RedisClient {
messageBody = typeof messageBody === 'object' ? JSON.stringify(messageBody) : messageBody; messageBody = typeof messageBody === 'object' ? JSON.stringify(messageBody) : messageBody;
this.client.lpush(queuedName, messageBody, function (err, reply) { this.client.lpush(queuedName, messageBody, function (err, reply) {
if (err) { 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); return new Error('lpush message error :' + err);
} else { } else {
console.log('lpush message success'); 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