9.7 Host Notifications
This topic provides information on Host Notifications.
In order to listen to any Host events and trigger subsequent alerts in OBDX for the same, please follow the below steps as part of extensibility:
Out-of-Box Notification Alert Support:
Update the output of the following script:
SELECT * FROM DIGX_CFG_CONFIG_ALL_B WHERE prop_id LIKE
'%KAFKA_CONFIG%structure-createdAndAuthorized@%';
New Notification Alert Support:
- Get the Avro schema format for the notification to be consumed from the host. Ensure that the deserialized objects based on the Avro are present in the class-path.
- Create a new consumer class that implements the IKafkaConsumable
interface. Consumers implementing this interface will always consume messages from
Kafka topics.
Override Methods:
- topicName(): Override this method to specify the name of
the topic the consumer should listen to. Returns String.
Example: structure-createdAndAuthorized
- consumerGroup(): Override this method to specify the consumer group name. Returns String.
- enableSeparateConsumerGroupsPerServer():
- When true, each instance of the consumer on each server creates its own consumer group.
- When false, all instances of this consumer across all servers share the same consumer group. Default is false.
- run(): Responsible for initiating the message consumption process. Within this method, the consume method is called with an instance of IMessageProcessor (created as part of point 4) to handle the processing of each consumed message.
- OOTB Reference: com.ofss.digx.kafka.liquiditymanagement.consumer.structure.StructureMessageConsumer
- topicName(): Override this method to specify the name of
the topic the consumer should listen to. Returns String.
- Create a file named com.ofss.digx.infra.events.kafka.consumer.IConsumer in resources/META-INF/services and provide the entry for the consumer class.
- Create a new class implementing
com.ofss.digx.infra.events.processor.IMessageProcessor for writing
business logic. This class will be used from the consumer and listener classes and
should be included in the service jar of the module.
Override Methods:
- process(K key, V data): Processes messages from the
consumer. The out-of-box host alert service (Eg:
com.ofss.digx.app.liquiditymanagement.service.hostalerts.HostAlertService)
should be invoked from this method.
key: The key object associated with the message.
data: The data to be processed
OOTB Reference: com.ofss.digx.app.liquiditymanagement.processor.structure.StructureMessageProcessor
- process(K key, V data): Processes messages from the
consumer. The out-of-box host alert service (Eg:
com.ofss.digx.app.liquiditymanagement.service.hostalerts.HostAlertService)
should be invoked from this method.
-
Kafka consumer configurations can be maintained in
DIGX_CFG_CONFIG_ALL_Bwith prop_id starting withKAFKA_CONFIG. For configurations specific to a topic, prop_id can be specified asTOPIC_NAME@CONFIGURATION.Example: KAFKA_CONFIG.structure-createdAndAuthorized@bootstrap.servers
- Configure a subscription based OBDX alert specific for the new notification configured. Post maintaining subscription for the new OBDX alert, subscribed users will receive OBDX alerts specific to the notification.
Parent topic: Liquidity Management