NotificationManager

mdxWebApiCore.Services. NotificationManager

Class which defines NotificationManager

Constructor

new NotificationManager()

Source:

Methods

(async) consumeAndProcessNotification(messageBroker, documentDb, configManagerObject, calibrationObject)

Description:
  • consumes and processes incoming notification messages.
Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const kafka = new mdx.Utils.Kafka({brokers: ["kafka-broker-url"]}, kafkaConfigMap);
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let notificationManagerObject = new mdx.Services.NotificationManager();
let configManagerObject = new mdx.Services.ConfigManager();
let calibrationObject = new mdx.Services.Calibration();
await notificationManagerObject.consumeAndProcessNotification(kafka,elastic,configManagerObject,calibrationObject);
Parameters:
Name Type Description
messageBroker MessageBroker MessageBroker Object
documentDb Database Database Object
configManagerObject Object configManager Object
calibrationObject Object calibration Object

(async) produceCalibrationNotification(messageBroker, input) → {Promise.<Object>}

Description:
  • returns a success message when the calibration input message is sent to the message broker.
Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const kafka = new mdx.Utils.Kafka({brokers: ["kafka-broker-url"]}, kafkaConfigMap);
let input = {timestamp: "2023-01-12T14:20:10.000Z", eventType: "upsert-all", calibration};
let notificationManagerObject = new mdx.Services.NotificationManager();
let result = await notificationManagerObject.produceCalibrationNotification(kafka,input);
Parameters:
Name Type Description
messageBroker MessageBroker MessageBroker Object
input Object Input object.
Properties
Name Type Description
timestamp string
eventType "upsert-all" | "upsert" | "delete"
calibration Object Calibration object
Returns:
A success message is returned
Type
Promise.<Object>

(async) produceConfigNotification(messageBroker, input) → {Promise.<Object>}

Description:
  • returns a success message when the config related input message is sent to the message broker.
Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const kafka = new mdx.Utils.Kafka({brokers: ["kafka-broker-url"]}, kafkaConfigMap);
let input = {docType: "mdx-mtmc-analytics", timestamp: "2023-01-12T14:20:10.000Z", eventType: "upsert", config};
let notificationManagerObject = new mdx.Services.NotificationManager();
let result = await notificationManagerObject.produceConfigNotification(kafka,input);
Parameters:
Name Type Description
messageBroker MessageBroker MessageBroker Object
input Object Input object.
Properties
Name Type Attributes Description
docType "mdx-mtmc-analytics"
timestamp string
eventType "upsert-all" | "upsert"
config string <nullable>
JSON stringified config object
Returns:
A success message is returned
Type
Promise.<Object>