@autofleet/rabbit 2.0.4-alpha → 2.0.4-beta
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 +4 -1
- package/package.json +1 -1
- package/src/index.ts +3 -1
package/dist/index.js
CHANGED
|
@@ -72,6 +72,7 @@ class RabbitMq {
|
|
|
72
72
|
&& (!msg.content['x-retry-count']
|
|
73
73
|
|| msg.content['x-retry-count'] < options.retries)) {
|
|
74
74
|
msg.content['x-retry-count'] = msg.content['x-retry-count'] ? msg.content['x-retry-count'] + 1 : 1;
|
|
75
|
+
// msg.content.nackCount = msg.content.nackCount ? msg.content.nackCount + 1 : 1;
|
|
75
76
|
yield this.sendToQueue(queue, msg.content);
|
|
76
77
|
}
|
|
77
78
|
else {
|
|
@@ -213,7 +214,9 @@ class RabbitMq {
|
|
|
213
214
|
];
|
|
214
215
|
callbackWithTimeout(callback, args, optionsWithDefaults.timeout, optionsWithDefaults.timeoutMessage);
|
|
215
216
|
}
|
|
216
|
-
|
|
217
|
+
else {
|
|
218
|
+
callback(RabbitMq.parseMsg(msg), this.ack(channel), this.nack(channel, queue, optionsWithDefaults, { messageTtl: deadMessageTtl }));
|
|
219
|
+
}
|
|
217
220
|
}),
|
|
218
221
|
]);
|
|
219
222
|
}));
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -121,6 +121,7 @@ class RabbitMq implements IAfRabbitMq {
|
|
|
121
121
|
|| msg.content['x-retry-count'] < options.retries)
|
|
122
122
|
) {
|
|
123
123
|
msg.content['x-retry-count'] = msg.content['x-retry-count'] ? msg.content['x-retry-count'] + 1 : 1;
|
|
124
|
+
// msg.content.nackCount = msg.content.nackCount ? msg.content.nackCount + 1 : 1;
|
|
124
125
|
await this.sendToQueue(queue, msg.content);
|
|
125
126
|
} else {
|
|
126
127
|
const deadQueue = `${queue}-dead`;
|
|
@@ -234,8 +235,9 @@ class RabbitMq implements IAfRabbitMq {
|
|
|
234
235
|
this.nack(channel, queue, optionsWithDefaults, { messageTtl: deadMessageTtl }),
|
|
235
236
|
];
|
|
236
237
|
callbackWithTimeout(callback, args, optionsWithDefaults.timeout, optionsWithDefaults.timeoutMessage);
|
|
238
|
+
} else {
|
|
239
|
+
callback(RabbitMq.parseMsg(msg), this.ack(channel), this.nack(channel, queue, optionsWithDefaults, { messageTtl: deadMessageTtl }));
|
|
237
240
|
}
|
|
238
|
-
callback(RabbitMq.parseMsg(msg), this.ack(channel), this.nack(channel, queue, optionsWithDefaults, { messageTtl: deadMessageTtl }));
|
|
239
241
|
},
|
|
240
242
|
),
|
|
241
243
|
]);
|