message-brokers 1.4.1 → 1.5.0
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/README.md +1 -6
- package/lib/configs/mqConfigs.js +1 -1
- package/lib/message-brokers.js +10 -0
- package/lib/rabbitmq/rabbitmq.helper.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,6 +39,7 @@ ACTIVE_MESSAGE_BROKER=rabbitmq
|
|
|
39
39
|
REDIS_PORT=6260
|
|
40
40
|
CACHING_ENABLED=true
|
|
41
41
|
RABBITMQ_DEPLOYMENT_ENV=stage (if using same rabbitmq stack for multiple environments, exchanges/queues/routing-keys get appended with this value. e.g. if rabbitmq deployment env is stage, then exchanges/queues/routing-keys will be appended with .stage)
|
|
42
|
+
DATACLOAK_DISABLE=true (if you want to disable datacloak queue for stage/demo deployments)
|
|
42
43
|
```
|
|
43
44
|
|
|
44
45
|
```javascript
|
|
@@ -129,10 +130,4 @@ messageBrokers.publishHarStub(har_stub);
|
|
|
129
130
|
|
|
130
131
|
// Publish raw_queue
|
|
131
132
|
messageBrokers.publishRawQueue(raw_queue);
|
|
132
|
-
|
|
133
|
-
// Publish har_stub_with_route_params
|
|
134
|
-
messageBrokers.publishHarStubWithRouteParams(har_stub_to_report_gen);
|
|
135
|
-
|
|
136
|
-
// Publish reportgen_response
|
|
137
|
-
messageBrokers.publishReportgenResponse(rg_response);
|
|
138
133
|
```
|
package/lib/configs/mqConfigs.js
CHANGED
|
@@ -10,7 +10,7 @@ const mqConfigs = [{
|
|
|
10
10
|
priorityQueue: false
|
|
11
11
|
}, {
|
|
12
12
|
queueName: "datacloak.queue",
|
|
13
|
-
routingKeyList: ["har", "har_meta", "lab_api_response", "purchase_details", "lab_location_data", "input_object", "trending_data"],
|
|
13
|
+
routingKeyList: ["har", "har_meta", "lab_api_response", "purchase_details", "lab_location_data", "input_object", "trending_data", "notification_messages_logs"],
|
|
14
14
|
priorityQueue: false
|
|
15
15
|
}, {
|
|
16
16
|
queueName: "raw-queue-processor",
|
package/lib/message-brokers.js
CHANGED
|
@@ -114,6 +114,16 @@ class MessageBrokers {
|
|
|
114
114
|
const response = await AmqpController.publishMessage(hv_exchange, "raw_queue", raw_queue);
|
|
115
115
|
return response;
|
|
116
116
|
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* This function is used publish notification_messages_logs into the exchange.
|
|
120
|
+
* @param {Object} notification_messages_logs
|
|
121
|
+
* @returns
|
|
122
|
+
*/
|
|
123
|
+
async publishNotificationMessagesLogs(notification_messages_logs) {
|
|
124
|
+
const response = await AmqpController.publishMessage(hv_exchange, "notification_messages_logs", notification_messages_logs);
|
|
125
|
+
return response;
|
|
126
|
+
}
|
|
117
127
|
async publishPendingMessageInCache() {
|
|
118
128
|
return await AmqpController.publishPendingMessageInCache();
|
|
119
129
|
}
|
|
@@ -29,6 +29,10 @@ RabbitMQHelper.initializePubSub = async () => {
|
|
|
29
29
|
});
|
|
30
30
|
await exchangeLogger(exchangeName);
|
|
31
31
|
for (const queueConfig of mq.queueConfigList) {
|
|
32
|
+
if (process.env.DATACLOAK_DISABLE && queueConfig.queueName === "datacloak.queue") {
|
|
33
|
+
console.log(`Skipping queue ${queueConfig.queueName} initialization due to DATACLOAK_DISABLE environment variable.`);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
32
36
|
await RabbitMQHelper.initializeAndBindQueue(rabbitmqChannel, exchangeName, queueConfig);
|
|
33
37
|
}
|
|
34
38
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "message-brokers",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "This package contains functions to publish the messages into the message brokers like rabbitmq.",
|
|
5
5
|
"main": "lib/message-brokers.js",
|
|
6
6
|
"types": "lib/types/message-brokers.d.ts",
|