Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Notifications Mediator service allows external tools to setup and schedule notifications for clients. This notifications act as reminders, so the user are aware of future activities. This, together with the Communication Mediator Service, allows the sending of the notifications through different communication channels.

...

The following diagram shows how the technology stack is connected:

...

Info

To know the DHIS2 event structure, you can check DHIS 2 Maintenance (psi-mis.org), program stage: CWS Notifications.

...

Send Notifications → move to a dedicated page

POST /dhis2/send-notifications

Send Notification endpoint retrieves all scheduled messages up to the time the endpoint is called and where the notification status is set as 'scheduled'. This endpoint prepares message content to be sent to Communication Mediator Service. After sending the messages, this service updates the notification status. Additional notes are included in the notification in case of message delivery failure or errors encountered within the messaging service.

...

...

Cronjob

Notification Mediator Service use a cron scheduler to send all the notifications that have already reached the scheduled date and which status is set to 'scheduled'. This CronJob runs every 2 minutes.

The cronjob uses notification endpoint named send notifications.

There are two main reasons to do it by date ranges:

  • DHIS2 endpoints restrictions

  • We get the notifications Notifications pending to send are retrieved before the current minute and after the previous 7 days. This way, if for some reason we have notifications pending to send for any reason (the server was down, DHIS2 was not working in the previous hours…) we can send the previous notifications.

...

  • image-20240209-071416.pngImage Added