@diia-inhouse/diia-queue 14.0.11 → 14.0.13
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.
|
@@ -9,7 +9,7 @@ import { AmqpConnection } from "./amqpConnection.js";
|
|
|
9
9
|
import { AmqpListener } from "./amqpListener.js";
|
|
10
10
|
import { AmqpPublisher } from "./amqpPublisher.js";
|
|
11
11
|
import { InternalServerError } from "@diia-inhouse/errors";
|
|
12
|
-
import
|
|
12
|
+
import _ from "lodash";
|
|
13
13
|
import { randomUUID } from "node:crypto";
|
|
14
14
|
import { EventEmitter } from "node:events";
|
|
15
15
|
import pTimeout from "p-timeout";
|
|
@@ -111,7 +111,7 @@ var RabbitMQProvider = class extends EventEmitter {
|
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
async makeAMQPConnection(client) {
|
|
114
|
-
return new AmqpConnection(this.rabbitmqConfig.connection, this.logger, this.rabbitmqConfig.reconnectOptions,
|
|
114
|
+
return new AmqpConnection(this.rabbitmqConfig.connection, this.logger, this.rabbitmqConfig.reconnectOptions, _.merge({ clientProperties: { connectionClientType: client } }, this.rabbitmqConfig.socketOptions));
|
|
115
115
|
}
|
|
116
116
|
async makeAMQPListener(queuesOptions) {
|
|
117
117
|
return new AmqpListener(await this.getConnection("listener"), this.logger, this.rabbitMQMetricsService, queuesOptions, this.systemServiceName);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { collectEventBusListeners } from "../utils.js";
|
|
2
|
-
import
|
|
2
|
+
import _ from "lodash";
|
|
3
3
|
//#region src/services/eventCommunicator.ts
|
|
4
4
|
var EventCommunicator = class {
|
|
5
5
|
logger;
|
|
@@ -31,8 +31,8 @@ var EventCommunicator = class {
|
|
|
31
31
|
getUnicastListeners() {
|
|
32
32
|
const listeners = [];
|
|
33
33
|
const { queuesOptions, exchangesOptions } = this.queueProvider.getMessageBrokerServiceConfig();
|
|
34
|
-
const queuesOptionsMap =
|
|
35
|
-
const exchangesOptionsMap =
|
|
34
|
+
const queuesOptionsMap = _.keyBy(queuesOptions, "name");
|
|
35
|
+
const exchangesOptionsMap = _.keyBy(exchangesOptions, "name");
|
|
36
36
|
for (const eventListener of this.listenerList) {
|
|
37
37
|
const { queueNames = [] } = eventListener;
|
|
38
38
|
for (const queueName of queueNames) {
|
package/dist/services/task.js
CHANGED
|
@@ -2,7 +2,7 @@ import { QueueTypes } from "../interfaces/messageBrokerServiceConfig.js";
|
|
|
2
2
|
import "../interfaces/index.js";
|
|
3
3
|
import constants_default from "../constants.js";
|
|
4
4
|
import Communicator from "./communicator.js";
|
|
5
|
-
import
|
|
5
|
+
import _ from "lodash";
|
|
6
6
|
//#region src/services/task.ts
|
|
7
7
|
var Task = class extends Communicator {
|
|
8
8
|
serviceName;
|
|
@@ -18,8 +18,8 @@ var Task = class extends Communicator {
|
|
|
18
18
|
}
|
|
19
19
|
async onInit() {
|
|
20
20
|
const { queuesOptions, exchangesOptions } = await this.init();
|
|
21
|
-
const queuesOptionsMap =
|
|
22
|
-
const exchangesOptionsMap =
|
|
21
|
+
const queuesOptionsMap = _.keyBy(queuesOptions, "name");
|
|
22
|
+
const exchangesOptionsMap = _.keyBy(exchangesOptions, "name");
|
|
23
23
|
for (const task of this.taskList) {
|
|
24
24
|
const { name: taskName, isDelayed = false, queueNames = [] } = task;
|
|
25
25
|
if (queueNames.length === 0) {
|
|
@@ -69,8 +69,8 @@ var Task = class extends Communicator {
|
|
|
69
69
|
getUnicastListeners() {
|
|
70
70
|
const listeners = [];
|
|
71
71
|
const { queuesOptions, exchangesOptions } = this.queueProvider.getMessageBrokerServiceConfig();
|
|
72
|
-
const queuesOptionsMap =
|
|
73
|
-
const exchangesOptionsMap =
|
|
72
|
+
const queuesOptionsMap = _.keyBy(queuesOptions, "name");
|
|
73
|
+
const exchangesOptionsMap = _.keyBy(exchangesOptions, "name");
|
|
74
74
|
for (const task of this.taskList) {
|
|
75
75
|
const { queueNames = [], name: taskName, isDelayed = false } = task;
|
|
76
76
|
if (queueNames.length === 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diia-inhouse/diia-queue",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Package provide queue functionality",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@diia-inhouse/configs": "7.0.0",
|
|
55
|
-
"@diia-inhouse/diia-logger": "4.
|
|
56
|
-
"@diia-inhouse/diia-metrics": "7.1.
|
|
57
|
-
"@diia-inhouse/env": "3.3.
|
|
55
|
+
"@diia-inhouse/diia-logger": "4.3.0",
|
|
56
|
+
"@diia-inhouse/diia-metrics": "7.1.6",
|
|
57
|
+
"@diia-inhouse/env": "3.3.2",
|
|
58
58
|
"@diia-inhouse/errors": "2.1.1",
|
|
59
59
|
"@diia-inhouse/oxc-config": "1.10.0",
|
|
60
60
|
"@diia-inhouse/test": "8.2.1",
|