@yolo-croket-dev/core 1.7.28-slowquery.0 → 1.7.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/interceptors/rpc.interceptor.js +19 -14
- package/package.json +1 -1
|
@@ -296,7 +296,13 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
296
296
|
.pipe((0, operators_1.timeout)({
|
|
297
297
|
each: this.DEFAULT_TIMEOUT,
|
|
298
298
|
with: () => {
|
|
299
|
-
msaLogger.error('RPCInterceptor timeout 발생', { traceId: execInterceptor.traceId }, {
|
|
299
|
+
msaLogger.error('RPCInterceptor timeout 발생', { traceId: execInterceptor.traceId }, {
|
|
300
|
+
message: this.DEFAULT_TIMEOUT_MESSAGE,
|
|
301
|
+
messagePattern: method,
|
|
302
|
+
durationMs: Date.now() - now,
|
|
303
|
+
reDeliveryCount,
|
|
304
|
+
staticRetryCount,
|
|
305
|
+
});
|
|
300
306
|
abortController.abort();
|
|
301
307
|
return (0, rxjs_1.throwError)(() => new exceptions_1.InternalServerError('TIMEOUT_ERROR', this.DEFAULT_TIMEOUT_MESSAGE));
|
|
302
308
|
},
|
|
@@ -318,39 +324,38 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
318
324
|
}),
|
|
319
325
|
// eslint-disable-next-line consistent-return
|
|
320
326
|
(0, operators_1.catchError)(async (err) => {
|
|
327
|
+
const isNackMessage = !execInterceptor.isMessageAck;
|
|
321
328
|
// timeout 에러 처리
|
|
322
329
|
const isTimeoutError = err instanceof Error && (err.name === 'TimeoutError' || err.message === this.DEFAULT_TIMEOUT_MESSAGE);
|
|
323
|
-
console.log('isTimeoutError: ', isTimeoutError);
|
|
324
|
-
console.log('err.name: ', err.name);
|
|
325
|
-
console.log('err.message: ', err.message, this.DEFAULT_TIMEOUT_MESSAGE);
|
|
326
330
|
if (isTimeoutError) {
|
|
327
|
-
msaLogger.error(
|
|
331
|
+
msaLogger.error(`[타임 아웃] 메시지 감지, ${isNackMessage ? '재전달' : '재전달하지 않음'}처리`, { traceId: execInterceptor.traceId }, {
|
|
328
332
|
error: {
|
|
329
333
|
message: err.message,
|
|
330
334
|
stack: err.stack,
|
|
331
335
|
name: err.name,
|
|
332
336
|
response: err.response,
|
|
337
|
+
isNackMessage,
|
|
333
338
|
},
|
|
339
|
+
messagePattern: method,
|
|
334
340
|
});
|
|
335
|
-
if (!execInterceptor.isMessageAck) {
|
|
336
|
-
channel.nack(message, false, true);
|
|
337
|
-
execInterceptor.isMessageAck = true;
|
|
338
|
-
message.properties.replyTo = undefined; /** replyTo가 존재하면 sendToQueue가 호출되므로, 삭제해주기 */
|
|
339
|
-
msaLogger.debug('TimeoutError occurred, message requeued called', { traceId: execInterceptor.traceId });
|
|
340
|
-
return new rxjs_1.Observable();
|
|
341
|
-
}
|
|
342
341
|
}
|
|
343
342
|
else {
|
|
344
|
-
msaLogger.error(
|
|
343
|
+
msaLogger.error(`에러 응답 전송 처리, ${isNackMessage ? '재전달' : '재전달하지 않음'}처리`, { traceId: execInterceptor.traceId }, {
|
|
345
344
|
error: {
|
|
346
345
|
message: err.message,
|
|
347
346
|
stack: err.stack,
|
|
348
347
|
name: err.name,
|
|
349
348
|
response: err.response,
|
|
350
349
|
},
|
|
350
|
+
messagePattern: method,
|
|
351
351
|
});
|
|
352
|
-
return new rxjs_1.Observable();
|
|
353
352
|
}
|
|
353
|
+
if (!execInterceptor.isMessageAck) {
|
|
354
|
+
channel.nack(message, false, true);
|
|
355
|
+
execInterceptor.isMessageAck = true;
|
|
356
|
+
message.properties.replyTo = undefined; /** replyTo가 존재하면 sendToQueue가 호출되므로, 삭제해주기 */
|
|
357
|
+
}
|
|
358
|
+
return new rxjs_1.Observable();
|
|
354
359
|
}), (0, operators_1.finalize)(() => {
|
|
355
360
|
this.gracefulShutdownService.popActiveInterceptors(execInterceptor);
|
|
356
361
|
abortController.abort();
|