Servicio de Notificaciones de DPS
Las notificaciones se envían después de que se realizan ciertas operaciones sobre las configuraciones.
Las notificaciones están deshabilitadas por defecto. Para habilitarlas, la propiedad ipf.dps.notification-service.enabled debe establecerse en true.
Actualmente solo soportamos notificaciones de operaciones CRUD. Así que, después de las operaciones de create, update y delete, se envía una notificación.
Aquí está el ejemplo del mensaje DpsCrudNotification:
{
"settings": "settingType",
"logicalUniqueKey": "logicalUniqueKey",
"action": "CREATED"
}
Aquí está el ejemplo de la interfaz DpsNotificationServicePort:
public interface DpsNotificationServicePort {
CompletionStage<Void> sendSettingCrudNotification(String logicalUniqueKey, String settingType, DpsCrudNotification.CrudNotificationAction action);
}
Al crear una configuración que requiere una aprobación, la notificación correspondiente no se enviará en el momento de la creación. Se enviará cuando la configuración sea aprobada.
DPS Notification Service Kafka
Esta es la implementación Kafka del Servicio de Notificaciones de DPS. Todas las notificaciones se envían a un tópico dedicado de Kafka.
Aquí está el ejemplo de configuración hocon para DPS Notification Service Kafka
ipf.dps {
notification-service {
enabled = true
kafka {
producer {
topic = DPS_CRUD_NOTIFICATION
restart-settings = ${common-flow-restart-settings}
kafka-clients {
group.id = dps-crud-notification-group
}
}
}
}
}
common-flow-restart-settings {
min-backoff = 1s
max-backoff = 5s
random-factor = 0.25
max-restarts = 5
max-restarts-within = 10m
}