@diia-inhouse/diia-queue 14.2.27 → 14.2.28
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.
|
@@ -24,10 +24,11 @@ var EventBus = class extends Communicator {
|
|
|
24
24
|
}
|
|
25
25
|
getProducerExchangesOptions() {
|
|
26
26
|
if (!this.queueName) return [];
|
|
27
|
-
const { rabbit: { declareOptions: { assertExchanges } = {} } } = this.queueProvider.getConfig();
|
|
27
|
+
const { topics = {}, rabbit: { declareOptions: { assertExchanges } = {} } } = this.queueProvider.getConfig();
|
|
28
28
|
const exchangeNames = this.optionsBuilder.getExchangeNamesByQueueName(this.queueName);
|
|
29
|
+
const exchangeNamesSet = new Set([...Object.keys(topics), ...exchangeNames]);
|
|
29
30
|
const exchangesOptions = [];
|
|
30
|
-
for (const exchangeName of
|
|
31
|
+
for (const exchangeName of exchangeNamesSet) exchangesOptions.push({
|
|
31
32
|
name: exchangeName,
|
|
32
33
|
declare: assertExchanges,
|
|
33
34
|
type: "topic",
|
|
@@ -40,18 +40,14 @@ var ScheduledTask = class extends Communicator {
|
|
|
40
40
|
getProducerExchangesOptions() {
|
|
41
41
|
const exchangesOptions = [];
|
|
42
42
|
const { topics = {}, rabbit: { declareOptions: { assertExchanges } = {} } } = this.queueProvider.getConfig();
|
|
43
|
-
const
|
|
43
|
+
const exchangeNamesByQueueName = this.optionsBuilder.getExchangeNamesByQueueName(this.queueName);
|
|
44
|
+
const exchangeNamesSet = new Set([...Object.keys(topics), ...exchangeNamesByQueueName]);
|
|
45
|
+
for (const exchangeName of exchangeNamesSet) exchangesOptions.push({
|
|
44
46
|
name: exchangeName,
|
|
45
47
|
type: "topic",
|
|
46
48
|
declare: assertExchanges,
|
|
47
49
|
bindTo: []
|
|
48
50
|
});
|
|
49
|
-
const exchangeNamesByQueueName = this.optionsBuilder.getExchangeNamesByQueueName(this.queueName);
|
|
50
|
-
const exchangeNamesSet = new Set([...Object.keys(topics), ...exchangeNamesByQueueName]);
|
|
51
|
-
for (const exchangeName of exchangeNamesSet) {
|
|
52
|
-
const exchangeOptions = createExchangeOptions(exchangeName);
|
|
53
|
-
exchangesOptions.push(exchangeOptions);
|
|
54
|
-
}
|
|
55
51
|
return exchangesOptions;
|
|
56
52
|
}
|
|
57
53
|
getRoutingKey(serviceName) {
|