@autofleet/rabbit 3.4.0-beta.10 → 3.4.0-beta.12
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 +16 -18
- package/package.json +1 -1
- package/src/index.ts +20 -21
package/dist/index.js
CHANGED
|
@@ -629,24 +629,22 @@ class RabbitMq {
|
|
|
629
629
|
]);
|
|
630
630
|
});
|
|
631
631
|
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
await
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
});
|
|
649
|
-
}
|
|
632
|
+
// TODO: [QUORUM-PHASE-3] Delete the old implementation
|
|
633
|
+
await this.saveConsumerOld(queue, callback, options);
|
|
634
|
+
const channelOld = await this.getNewChannelOld({
|
|
635
|
+
name: `consume-exchange-${exchange}-queue-${queue}-old`,
|
|
636
|
+
connection: this.oldConsumeConnection,
|
|
637
|
+
});
|
|
638
|
+
await channelOld.addSetup(async (c) => {
|
|
639
|
+
const assertExchange = await (0, utils_1.assertExchangeFanout)(c, exchange);
|
|
640
|
+
await c.assertQueue(queue);
|
|
641
|
+
this.oldExchanges[exchange] = assertExchange;
|
|
642
|
+
await c.prefetch(limit, false);
|
|
643
|
+
return Promise.all([
|
|
644
|
+
c.bindQueue(queue, exchange, ''),
|
|
645
|
+
this.consumeOld(queue, callback, options),
|
|
646
|
+
]);
|
|
647
|
+
});
|
|
650
648
|
}
|
|
651
649
|
// Used by the microservices to publish messages to the exchange
|
|
652
650
|
// TODO: [QUORUM-PHASE-2] Change the implementation to the new one
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -863,28 +863,27 @@ class RabbitMq implements IAfRabbitMq {
|
|
|
863
863
|
),
|
|
864
864
|
]);
|
|
865
865
|
});
|
|
866
|
-
} else {
|
|
867
|
-
// TODO: [QUORUM-PHASE-3] Delete the old implementation
|
|
868
|
-
await this.saveConsumerOld(queue, callback, options);
|
|
869
|
-
const channelOld: ChannelWrapper = await this.getNewChannelOld({
|
|
870
|
-
name: `consume-exchange-${exchange}-queue-${queue}-old`,
|
|
871
|
-
connection: this.oldConsumeConnection,
|
|
872
|
-
});
|
|
873
|
-
await channelOld.addSetup(async (c: ConfirmChannel) => {
|
|
874
|
-
const assertExchange = await assertExchangeFanout(c, exchange);
|
|
875
|
-
await c.assertQueue(queue);
|
|
876
|
-
this.oldExchanges[exchange] = assertExchange;
|
|
877
|
-
await c.prefetch(limit, false);
|
|
878
|
-
return Promise.all([
|
|
879
|
-
c.bindQueue(queue, exchange, ''),
|
|
880
|
-
this.consumeOld(
|
|
881
|
-
queue,
|
|
882
|
-
callback,
|
|
883
|
-
options,
|
|
884
|
-
),
|
|
885
|
-
]);
|
|
886
|
-
});
|
|
887
866
|
}
|
|
867
|
+
// TODO: [QUORUM-PHASE-3] Delete the old implementation
|
|
868
|
+
await this.saveConsumerOld(queue, callback, options);
|
|
869
|
+
const channelOld: ChannelWrapper = await this.getNewChannelOld({
|
|
870
|
+
name: `consume-exchange-${exchange}-queue-${queue}-old`,
|
|
871
|
+
connection: this.oldConsumeConnection,
|
|
872
|
+
});
|
|
873
|
+
await channelOld.addSetup(async (c: ConfirmChannel) => {
|
|
874
|
+
const assertExchange = await assertExchangeFanout(c, exchange);
|
|
875
|
+
await c.assertQueue(queue);
|
|
876
|
+
this.oldExchanges[exchange] = assertExchange;
|
|
877
|
+
await c.prefetch(limit, false);
|
|
878
|
+
return Promise.all([
|
|
879
|
+
c.bindQueue(queue, exchange, ''),
|
|
880
|
+
this.consumeOld(
|
|
881
|
+
queue,
|
|
882
|
+
callback,
|
|
883
|
+
options,
|
|
884
|
+
),
|
|
885
|
+
]);
|
|
886
|
+
});
|
|
888
887
|
}
|
|
889
888
|
|
|
890
889
|
// Used by the microservices to publish messages to the exchange
|