2024-07-09 - Notification Stack Flow

From Izara Wiki
Jump to navigation Jump to search

Service Stack - Notifications

Overview

Service - Activity Switchboard

  • Receives most messages sent within the entire project's serverless flow from subscribe to In or Out Topics of external services
  • Allows services to register a set of triggers that are checked when each message is received
  • If all triggers pass a message is sent to OutTriggerGroupPassed for subscribed services. eg. Notifition Manager

Service - Notification Manager

  • Subscribe OutTriggerGroupPassed of Activity Swichboard service
  • Consolidates or sends notifications to any number of receiver services
  • Will be used for user notifications but can have other types of receiver services added
  • Notification groups set whether activities are considated (eg per day/per month/per x number of activities)
  • If considated activities are stored here until sending is triggered, according to the considation rules. If not consolidated they are sent on immediately

Service - Contact Method Email

  • Subscribe OutNewNotification of Notification Manager service
  • Send email to user

Flow

Activity Swicthboard: ReceiveMsg

  • subscribes to In and Out topics of external services for any number of services
  • checkTrigger
    • checkTrigger for topicName
    • checkTrigger for serviceName
    • recursiveCheckProperties in message and checkProperties for each properties
    • checkTrigger for each attributes
  • if all triggers of tirggerGroup is match, send message to OutTriggerGroupPassed
  • receiverTag gets added to message attributes so can be filtered for by receiving service

Notification Manager: RcvActivityMsg

  • subscribes to OutTriggerGroupPassed topic of Service - Activity Switchboard service
  • find notificationGroup and setting node by getNodeAndRelationship
  • If have setting and consolidated = true ---> save notification message to ConsolidationPending table
  • else send message to OutNewNotification topic
  • receiverTag gets added to message attributes so can be filtered for by receiving service

Contact Method Email: RcvNotification

  • subscribes to OutNewNotification topic of Service - Notification Manager service
  • get email that matches userId and uniqueId from Emails table
  • send email