@autofleet/rabbit 2.2.6 → 2.2.7
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/dist/index.js +0 -5
- package/package.json +1 -1
- package/src/index.ts +0 -5
package/dist/index.js
CHANGED
|
@@ -55,9 +55,6 @@ class RabbitMq {
|
|
|
55
55
|
const { properties: { timestamp, headers } } = msg;
|
|
56
56
|
if (timestamp && (headers === null || headers === void 0 ? void 0 : headers.redisTimestampValidationKey) && this.redisClient) {
|
|
57
57
|
const lastMessageTimestamp = yield this.redisClient.getAsync(headers.redisTimestampValidationKey);
|
|
58
|
-
logger_1.default.info('rabbit: checking if should consume params', {
|
|
59
|
-
msg, timestamp, headers, lastMessageTimestamp,
|
|
60
|
-
});
|
|
61
58
|
return !lastMessageTimestamp || (parseInt(lastMessageTimestamp, 10) <= parseInt(timestamp, 10));
|
|
62
59
|
}
|
|
63
60
|
return true;
|
|
@@ -282,7 +279,6 @@ class RabbitMq {
|
|
|
282
279
|
}
|
|
283
280
|
const parsedMessage = RabbitMq.parseMsg(msg);
|
|
284
281
|
const shouldConsume = yield this.shouldConsumeMessageByTimestamp(parsedMessage);
|
|
285
|
-
logger_1.default.info('rabbit: trying to consume', { queue, shouldConsume, msg });
|
|
286
282
|
if (!shouldConsume) {
|
|
287
283
|
return this.ack(channel, msg)(msg);
|
|
288
284
|
}
|
|
@@ -332,7 +328,6 @@ class RabbitMq {
|
|
|
332
328
|
RabbitMq.validateName('queue', queue);
|
|
333
329
|
const channel = yield this.assertChannel();
|
|
334
330
|
yield this.assertQueue(queue, options);
|
|
335
|
-
logger_1.default.info('rabbit: sending to queue', { queue, content, customHeaders });
|
|
336
331
|
return channel.sendToQueue(queue, Buffer.from(JSON.stringify(content)), RabbitMq.getPublishOptions(customHeaders));
|
|
337
332
|
}));
|
|
338
333
|
});
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -150,9 +150,6 @@ class RabbitMq implements IAfRabbitMq {
|
|
|
150
150
|
const { properties: { timestamp, headers } } = msg;
|
|
151
151
|
if (timestamp && headers?.redisTimestampValidationKey && this.redisClient) {
|
|
152
152
|
const lastMessageTimestamp = await this.redisClient.getAsync(headers.redisTimestampValidationKey);
|
|
153
|
-
logger.info('rabbit: checking if should consume params', {
|
|
154
|
-
msg, timestamp, headers, lastMessageTimestamp,
|
|
155
|
-
});
|
|
156
153
|
return !lastMessageTimestamp || (parseInt(lastMessageTimestamp, 10) <= parseInt(timestamp, 10));
|
|
157
154
|
}
|
|
158
155
|
return true;
|
|
@@ -355,7 +352,6 @@ class RabbitMq implements IAfRabbitMq {
|
|
|
355
352
|
}
|
|
356
353
|
const parsedMessage = RabbitMq.parseMsg(msg);
|
|
357
354
|
const shouldConsume = await this.shouldConsumeMessageByTimestamp(parsedMessage);
|
|
358
|
-
logger.info('rabbit: trying to consume', { queue, shouldConsume, msg });
|
|
359
355
|
if (!shouldConsume) {
|
|
360
356
|
return this.ack(channel, msg)(msg);
|
|
361
357
|
}
|
|
@@ -413,7 +409,6 @@ class RabbitMq implements IAfRabbitMq {
|
|
|
413
409
|
RabbitMq.validateName('queue', queue);
|
|
414
410
|
const channel: ChannelWrapper = await this.assertChannel();
|
|
415
411
|
await this.assertQueue(queue, options);
|
|
416
|
-
logger.info('rabbit: sending to queue', { queue, content, customHeaders });
|
|
417
412
|
return channel.sendToQueue(queue,
|
|
418
413
|
Buffer.from(JSON.stringify(content)),
|
|
419
414
|
RabbitMq.getPublishOptions(customHeaders));
|