@yolo-croket-dev/core 1.7.9 → 1.7.10

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.
@@ -105,6 +105,7 @@ let LoggingServiceInterceptor = class LoggingServiceInterceptor {
105
105
  from: pastFrom,
106
106
  froms: pastFroms,
107
107
  },
108
+ startedAt: Date.now(),
108
109
  });
109
110
  const currentSpan = dd_trace_1.default.scope().active();
110
111
  let loggingSpan = null;
@@ -135,7 +135,7 @@ let RPCInterceptor = class RPCInterceptor {
135
135
  // return data;
136
136
  // }
137
137
  async intercept(context, next) {
138
- var _a, _b;
138
+ var _a, _b, _c;
139
139
  const options = this.reflector.get('rpcInterceptorScope', context.getHandler());
140
140
  const args = context.getArgs();
141
141
  const arg = args[0];
@@ -149,6 +149,7 @@ let RPCInterceptor = class RPCInterceptor {
149
149
  const isAdmin = content.data.param ? content.data.param.isAdmin : false;
150
150
  const reDeliveryCount = Number(message.properties.headers['x-delivery-count']) || 0; /** 몇번 재전달되었는지 */
151
151
  const staticRetryCount = Number(options === null || options === void 0 ? void 0 : options.messageRetryCount) || 0; /** 최대 재시도 갯수 */
152
+ const isRedelivery = message.fields.redelivered;
152
153
  const method = content.pattern;
153
154
  const correlationId = message.properties.correlationId;
154
155
  const execInterceptor = {
@@ -167,14 +168,24 @@ let RPCInterceptor = class RPCInterceptor {
167
168
  return new rxjs_1.Observable();
168
169
  }
169
170
  if (!staticRetryCount && reDeliveryCount > 0) {
170
- channel.sendToQueue(message.properties.replyTo, Buffer.from(JSON.stringify({
171
- isError: true,
172
- message: 'RETRY_COUNT_ZERO_OR_NO_RETRY',
173
- status: 500,
174
- duration: Date.now() - now,
175
- arg,
176
- timestamp: new Date(),
177
- })), { correlationId: message.properties.correlationId });
171
+ msaLogger.debug('RETRY_COUNT_ZERO_OR_NO_RETRY debug param', { traceId: ((_b = content.data.param) === null || _b === void 0 ? void 0 : _b.traceId) || 'RETRY_COUNT_ZERO_OR_NO_RETRY' }, {
172
+ properties: message.properties,
173
+ fields: message.fields,
174
+ time: Date.now(),
175
+ isRedelivery,
176
+ reDeliveryCount,
177
+ staticRetryCount,
178
+ });
179
+ if (isRedelivery) {
180
+ channel.sendToQueue(message.properties.replyTo, Buffer.from(JSON.stringify({
181
+ isError: true,
182
+ message: 'RETRY_COUNT_ZERO_OR_NO_RETRY',
183
+ status: 500,
184
+ duration: Date.now() - now,
185
+ arg,
186
+ timestamp: new Date(),
187
+ })), { correlationId: message.properties.correlationId });
188
+ }
178
189
  channel.nack(message, false, false); /** 아마도 기본 30분 타임아웃이 지나고 새로 들어오면 발생할 예정, DLQ로 이동 */
179
190
  message.properties.replyTo = undefined; /** replyTo가 존재하면 sendToQueue가 호출되므로, 삭제해주기 */
180
191
  return new rxjs_1.Observable();
@@ -246,7 +257,7 @@ let RPCInterceptor = class RPCInterceptor {
246
257
  };
247
258
  localErrorProcessor = localErrorProcessor.bind(this);
248
259
  /** 파일 객체 처리 */
249
- (0, functions_1.reWriteFileValue)((_b = content === null || content === void 0 ? void 0 : content.data) === null || _b === void 0 ? void 0 : _b.file);
260
+ (0, functions_1.reWriteFileValue)((_c = content === null || content === void 0 ? void 0 : content.data) === null || _c === void 0 ? void 0 : _c.file);
250
261
  if (options) {
251
262
  if (options.maxLengthKeys && options.maxLengthKeys.length) {
252
263
  for (const key of options.maxLengthKeys) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/core",
3
- "version": "1.7.9",
3
+ "version": "1.7.10",
4
4
  "author": "Yolo Co., Ltd.",
5
5
  "description": "Yolo commonization module",
6
6
  "main": "index.js",
@@ -17,7 +17,7 @@
17
17
  "@nestjs/common": "^8.2.3",
18
18
  "@nestjs/microservices": "9.0.8",
19
19
  "@yolo-croket-dev/logger": "^1.0.15",
20
- "@yolo-croket-dev/msa-logger": "^3.0.1",
20
+ "@yolo-croket-dev/msa-logger": "^3.0.4",
21
21
  "@yolo-croket-dev/redis": "^1.0.23",
22
22
  "@yolo-croket-dev/swagger": "^0.0.7",
23
23
  "axios": "^1.1.3",