message-brokers 1.4.2 → 1.5.1

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 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,4 +130,7 @@ messageBrokers.publishHarStub(har_stub);
129
130
 
130
131
  // Publish raw_queue
131
132
  messageBrokers.publishRawQueue(raw_queue);
133
+
134
+ // Publish notification_messages_logs
135
+ messageBrokers.publishNotificationMessagesLogs(notification_messages_logs);
132
136
  ```
@@ -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",
@@ -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 === "true" && 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.4.2",
3
+ "version": "1.5.1",
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",