@yolo-croket-dev/core 1.7.18-slowquery.2 → 1.7.18-slowquery.4

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.
@@ -252,19 +252,23 @@ let RPCInterceptor = class RPCInterceptor {
252
252
  errMessage,
253
253
  errAction,
254
254
  };
255
+ const isTimeoutError = err instanceof Error && err.name === 'TimeoutError';
256
+ if (isTimeoutError) {
257
+ channel.nack(message, false, true);
258
+ message.properties.replyTo = undefined; /** replyTo가 존재하면 sendToQueue가 호출되므로, 삭제해주기 */
259
+ return rxjs_1.EMPTY;
260
+ }
255
261
  if (!Number.isNaN(staticRetryCount)
256
262
  && staticRetryCount
257
263
  && err.isRetry !== false) {
258
264
  /** 재시도 로직이 필요한 경우, 0보다 커야 정의된것. 기본값이 0, isRetry값이 false로 정의된 에러가 아니라면 전부 재시도 */
259
265
  if (reDeliveryCount <= (staticRetryCount - 1)) { /** 재시도 횟수가 있고, 재시도 횟수보다 적을 경우, 0부터 카운팅 되므로 -1 */
260
- console.log('RETRY 재처리');
261
266
  message.properties.headers['x-requeue-reason'] = 'RETRY';
262
267
  channel.nack(message, false, true);
263
268
  message.properties.replyTo = undefined; /** replyTo가 존재하면 sendToQueue가 호출되므로, 삭제해주기 */
264
269
  isAck = true;
265
270
  }
266
271
  else {
267
- console.log('DLQ 전달');
268
272
  const dlqMessage = JSON.stringify(abstractAmqpHandlerData);
269
273
  channel.sendToQueue(message.properties.replyTo, Buffer.from(dlqMessage), { correlationId: message.properties.correlationId });
270
274
  message.properties.headers['x-requeue-reason'] = 'DLQ-FORWARD';
@@ -352,10 +356,6 @@ let RPCInterceptor = class RPCInterceptor {
352
356
  }), (0, operators_1.catchError)(async (err) => {
353
357
  // timeout 에러 처리
354
358
  msaLogger.error('Timeout occurred, requeuing message', { traceId: execInterceptor.traceId }, { error: err });
355
- // 메시지를 Requeue
356
- channel.nack(message, false, true);
357
- // 에러를 다시 throw하여 상위에서 처리할 수 있도록 함
358
- throw err;
359
359
  }), (0, operators_1.finalize)(() => {
360
360
  this.gracefulShutdownService.popActiveInterceptors(execInterceptor);
361
361
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/core",
3
- "version": "1.7.18-slowquery.2",
3
+ "version": "1.7.18-slowquery.4",
4
4
  "author": "Yolo Co., Ltd.",
5
5
  "description": "Yolo commonization module",
6
6
  "main": "index.js",