@yolo-croket-dev/core 1.7.14 → 1.7.16

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.
@@ -5,7 +5,6 @@ import { GracefulShutdownService } from '../modules/graceful-shutdown/graceful-s
5
5
  export declare class RPCInterceptor implements NestInterceptor {
6
6
  private readonly reflector;
7
7
  private readonly gracefulShutdownService;
8
- private readonly STATIC_NOT_DEFINE_RETRY_ATTEMPT;
9
8
  constructor(reflector: Reflector, gracefulShutdownService: GracefulShutdownService);
10
9
  private maxLengthOverShorten;
11
10
  private updateMaxLengthArrayShorten;
@@ -52,7 +52,6 @@ let RPCInterceptor = class RPCInterceptor {
52
52
  constructor(reflector, gracefulShutdownService) {
53
53
  this.reflector = reflector;
54
54
  this.gracefulShutdownService = gracefulShutdownService;
55
- this.STATIC_NOT_DEFINE_RETRY_ATTEMPT = 3;
56
55
  }
57
56
  maxLengthOverShorten(data) {
58
57
  if (typeof data !== 'string') {
@@ -160,11 +159,11 @@ let RPCInterceptor = class RPCInterceptor {
160
159
  if (this.gracefulShutdownService.isApplicationExit) {
161
160
  msaLogger.debug('RPCInterceptor isApplicationExit called', { traceId: 'IS_APPLICATION_EXIT' });
162
161
  channel.cancel(message.fields.consumerTag);
163
- return new rxjs_1.Observable();
162
+ return rxjs_1.EMPTY;
164
163
  }
165
164
  if (!staticRetryCount && reDeliveryCount > 0) {
166
165
  // 직접 메시지가 재시도 처리가 된 경우에는 로그만 남기고 처리하지 않음
167
- msaLogger.debug(`RETRY_COUNT_ZERO_OR_NO_RETRY 발생 전, 재시도 처리 (${reDeliveryCount}/${this.STATIC_NOT_DEFINE_RETRY_ATTEMPT})`, { traceId: ((_b = content.data.param) === null || _b === void 0 ? void 0 : _b.traceId) || 'RETRY_COUNT_ZERO_OR_NO_RETRY' }, {
166
+ msaLogger.debug('RETRY_COUNT_ZERO_OR_NO_RETRY 발생 전, redelivery 발생', { traceId: ((_b = content.data.param) === null || _b === void 0 ? void 0 : _b.traceId) || 'RETRY_COUNT_ZERO_OR_NO_RETRY' }, {
168
167
  messagePattern: method,
169
168
  properties: message.properties,
170
169
  fields: message.fields,
@@ -172,20 +171,9 @@ let RPCInterceptor = class RPCInterceptor {
172
171
  reDeliveryCount,
173
172
  staticRetryCount,
174
173
  });
175
- // 무한 재시도가 일어날 수 있으므로 재시도 카운트가 지정되지 않은 이벤트의 경우에는 횟수로 재실행 할 수 있도록
176
- if (reDeliveryCount >= this.STATIC_NOT_DEFINE_RETRY_ATTEMPT) {
177
- channel.sendToQueue(message.properties.replyTo, Buffer.from(JSON.stringify({
178
- isError: true,
179
- message: 'RETRY_COUNT_ZERO_OR_NO_RETRY',
180
- status: 500,
181
- duration: Date.now() - now,
182
- arg,
183
- timestamp: new Date(),
184
- })), { correlationId: message.properties.correlationId });
185
- channel.nack(message, false, false); /** 아마도 기본 30분 타임아웃이 지나고 새로 들어오면 발생할 예정, DLQ로 이동 */
186
- message.properties.replyTo = undefined; /** replyTo가 존재하면 sendToQueue가 호출되므로, 삭제해주기 */
187
- return new rxjs_1.Observable();
188
- }
174
+ channel.nack(message, false, false); /** 아마도 기본 30분 타임아웃이 지나고 새로 들어오면 발생할 예정, DLQ로 이동 */
175
+ message.properties.replyTo = undefined; /** replyTo가 존재하면 sendToQueue가 호출되므로, 삭제해주기 */
176
+ return rxjs_1.EMPTY;
189
177
  }
190
178
  const noAck = message.fields.routingKey.includes('ASYNC');
191
179
  let localErrorProcessor = async (err) => {
@@ -252,7 +240,7 @@ let RPCInterceptor = class RPCInterceptor {
252
240
  if (!noAck && !isAck) {
253
241
  channel.ack(message);
254
242
  }
255
- return new rxjs_1.Observable();
243
+ return rxjs_1.EMPTY;
256
244
  };
257
245
  localErrorProcessor = localErrorProcessor.bind(this);
258
246
  /** 파일 객체 처리 */
@@ -273,7 +261,7 @@ let RPCInterceptor = class RPCInterceptor {
273
261
  }
274
262
  catch (err) {
275
263
  await localErrorProcessor(err);
276
- return new rxjs_1.Observable();
264
+ return rxjs_1.EMPTY;
277
265
  }
278
266
  }
279
267
  if (content.pattern === 'UPLOAD_FILE') {
@@ -25,7 +25,7 @@ class GracefulServerRMQ extends microservices_1.ServerRMQ {
25
25
  if (!this.queueOptions.noAssert) {
26
26
  await channel.assertQueue(this.queue, this.queueOptions);
27
27
  }
28
- await channel.prefetch(this.prefetchCount, this.isGlobalPrefetchCount);
28
+ await channel.prefetch(this.options.prefetchCount || 0, this.options.isGlobalPrefetchCount);
29
29
  const { consumerTag } = await channel.consume(this.queue, (msg) => this.handleMessage(msg, channel), { noAck: false });
30
30
  this.consumerTag = consumerTag;
31
31
  callback();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/core",
3
- "version": "1.7.14",
3
+ "version": "1.7.16",
4
4
  "author": "Yolo Co., Ltd.",
5
5
  "description": "Yolo commonization module",
6
6
  "main": "index.js",
@@ -15,7 +15,6 @@
15
15
  "license": "UNLICENSED",
16
16
  "dependencies": {
17
17
  "@nestjs/common": "^8.2.3",
18
- "@nestjs/microservices": "9.0.8",
19
18
  "@yolo-croket-dev/logger": "^1.0.15",
20
19
  "@yolo-croket-dev/msa-logger": "^3.0.4",
21
20
  "@yolo-croket-dev/redis": "^1.0.23",