redis-smq 7.1.2 → 7.1.3
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 7.1.3 (2022-10-26)
|
|
4
|
+
|
|
5
|
+
* test(FanOutExchangeManager): test binding queues of different types (d2e287c)
|
|
6
|
+
* fix(FanOutExchangeManager): forbid binding queues of different types (0df6bdc)
|
|
7
|
+
|
|
3
8
|
## 7.1.2 (2022-10-22)
|
|
4
9
|
|
|
5
10
|
* fix(FanOutExchangeManager): fix unbindQueue() transaction handling (dec63de)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FanOutExchangeQueueError = void 0;
|
|
4
|
+
const exchange_error_1 = require("./exchange.error");
|
|
5
|
+
class FanOutExchangeQueueError extends exchange_error_1.ExchangeError {
|
|
6
|
+
constructor() {
|
|
7
|
+
super('Binding different types of queues to the same exchange is not allowed.');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.FanOutExchangeQueueError = FanOutExchangeQueueError;
|
|
11
|
+
//# sourceMappingURL=fan-out-exchange-queue.error.js.map
|
|
@@ -8,6 +8,7 @@ const queue_1 = require("../queue-manager/queue");
|
|
|
8
8
|
const redis_keys_1 = require("../../common/redis-keys/redis-keys");
|
|
9
9
|
const configuration_1 = require("../../config/configuration");
|
|
10
10
|
const exchange_error_1 = require("./errors/exchange.error");
|
|
11
|
+
const fan_out_exchange_queue_error_1 = require("./errors/fan-out-exchange-queue.error");
|
|
11
12
|
class FanOutExchangeManager {
|
|
12
13
|
constructor(config, redisClient, logger) {
|
|
13
14
|
this.redisClient = redisClient;
|
|
@@ -47,6 +48,25 @@ class FanOutExchangeManager {
|
|
|
47
48
|
redis_smq_common_1.async.waterfall([
|
|
48
49
|
(cb) => this.redisClient.watch([keyQueues, keyQueueSettings, keyExchangeBindings], (err) => cb(err)),
|
|
49
50
|
(cb) => queue_1.Queue.getSettings(this.config, this.redisClient, queue, cb),
|
|
51
|
+
(queueSettings, cb) => this.getExchangeQueues(exchange, (err, queues) => {
|
|
52
|
+
if (err)
|
|
53
|
+
cb(err);
|
|
54
|
+
else {
|
|
55
|
+
const eQueue = queues === null || queues === void 0 ? void 0 : queues.pop();
|
|
56
|
+
if (eQueue)
|
|
57
|
+
queue_1.Queue.getSettings(this.config, this.redisClient, eQueue, (err, exchangeQueueSetting) => {
|
|
58
|
+
if (err)
|
|
59
|
+
cb(err);
|
|
60
|
+
else if ((exchangeQueueSetting === null || exchangeQueueSetting === void 0 ? void 0 : exchangeQueueSetting.priorityQueuing) !==
|
|
61
|
+
queueSettings.priorityQueuing)
|
|
62
|
+
cb(new fan_out_exchange_queue_error_1.FanOutExchangeQueueError());
|
|
63
|
+
else
|
|
64
|
+
cb(null, queueSettings);
|
|
65
|
+
});
|
|
66
|
+
else
|
|
67
|
+
cb(null, queueSettings);
|
|
68
|
+
}
|
|
69
|
+
}),
|
|
50
70
|
(queueSettings, cb) => {
|
|
51
71
|
const currentExchangeParams = queueSettings.exchange;
|
|
52
72
|
if (currentExchangeParams === exchangeParams)
|