...
Current architecture diagram Link
Proposed Changes:
...
Redis:
To pass data from DMW to new notification service, We planned to use Kafka but in the same way we can use Redis Stream/Redis PubSub also.
...
Code Block |
---|
{ service: "discussion-forum", // Service Name headers: { //reqrequest tracebility sid: "X-Session-id" // from headers traceID: "X-Request-id" // from headers }, *notifcationData: { // Actual Notification request payload "* ids": ["sunbird-user-identifiers"], // sunbird identifiers (To which user need to send notification) "*createdBy": { *id, name, type // Which User is doing the action id: "sunbird-user-identifier", name: "sunbird-username", type: "User" } "action": { "category": "discussion-forum" // Service name type: "", // action type template: { type: "JSON", params: { // Based on params notification service will form the notification message param1: "", param2: "", param3: "", } } } "* additionalInfo": { // specific to the service & common for all API's of the service. Flink job will parse the object & construct specific to Notfi API " context": { // this is mainly used to know on what context this notification was created. cid: "", // category id sbItendifier: "", // sunbird Group/Course/Batch identifiers sbType: "" // type is Group/Course/Batch ... etc }, // based on resp derive the below fields " category": { " cid": "", // caregory "title"(Under which category this notification created) title: "", // category title " pid": "" // what is parent category id for cid } // Flink job has to call API;s to get names of these below (cid, tid, pid etc) topic: { tid: "", // topic ID title: "" // Topic title } post: { pid: "tid": "","", // Post id title: "" // Post tile } } } |
Example:
Code Block |
---|
{ service: "discussion-forum", headers: { sid: "bvDfBPexQFvNA2oyZ2A2slhUJH-H9PIw", traceID: "title": """bca07081-f0ca-3f0d-424c-a1a77a0215fd" }, notifcationData: { ids: ["55154dfc-007e-4fdf-be7f-c2660a6be4ad", "55154dfc-007e-4fdf-be7f-c2660a6beedfrt"], createdBy: { id: "55154dfc-007e-4fdf-be7f-c2660a6bevvcd", name: "venkatkadiveti", type: "User" }, action: { category: "discussion-forum", type: "member-replied", template: { type: "JSON", params: { param1: "VenkatKadiveti", param2: "post": { "pid": "","replied", param3: "topic", } } }, additionalInfo: { context: { cid: "4", sbItendifier: "3033827f-b90c-42a8-8e81-7e2b3eca68e5", sbType: "Group" }, category: { cid: 4, title: "General Discussion", pid: "2" }, topic: { tid: "12", title: "How to register slot for Covid vaccine?" }, post: { pid: "14"title", title: "you can register for Co-WIN portal" } } } |
Publish topic in kafka with the above data.
Flink job will trigger and receive the kafka topic data(Notification Objcet).
With notification object, Flink job will trigger notification service.
Type2:
If the parent service don’t have the action data the we have to send service
and url
then particular flink job will add the required action data. The parent service has to send this data.
...