Versions Compared

Key

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

...

  • 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.

...

Upstream service will use type2 structure, when they do not have information on template . Flink Job will process the data and generate notification api structure and then trigger the notification service. Flink job may call apis or information should be given on the additionalInfo.

Schema Request:

Code Block
{
  "service":  "groups" // Mandatory service name (use this as "action.category") 
  "url": "end-point"  // Mandatory (flink jobs will use this to add "action.type"
  "headers": {  //req tracebility
    "sid": // from headers
    "traceID": // from headers
  },
  "*notifcationData": {
    "*ids": [],       //Ids of the user may contains userid,email,phone,device id
    "createdBy": {    //Mandatory
        "id":
        "name":
        "type":
    },
    "action": {       
      // "category": flink job will device based on 'service'
      // type: flinkservice jobneeds willto decide based on 'url'be passed
      // template: flink job will decide based on 'type/url' and additionalInfo
    }
  "*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": { 
        cid: "",
        sbItendifier: "",
        sbType: ""
      }
   }
}

Examples :

  • Step 1: Group service will push the event in the below format

Group Activity Added Notification Used Case:

Code Block
{
  "service":  "groups" // service name (use
this as "action.category")
  urlurl": "end-point/v1/group/update" (flink
jobs will use this to add "action.type"
  headersheaders": {  //req tracebility
    sid:"sid": "13ad-32d3-daew4-131w" // from headers
    traceID:"traceId": 43ad-3dd3-da23-133w" // from headers
  },
  *"notifcationData": {
    "*ids": ["de43-fsw3-aqw2-rty4","de43-fsw3-aqw2-rty4"],
    "*createdBy": { *id, name, type }
       "id":"1kd1-d1e1-4rf3-daw2",
       "actionname":"John",
{       // "categorytype":"User"
flink job will get it}
based on service context in additional Info"action": {
       // "type: //service will pass
      // template: flink job will generate based on additionalInfo":"ACTIVITY_ADD"      
    }
  "*additionalInfo": {  // specific to the service & common for all API's of the service. Flink job will parse the object & construct specific to Notfi API
    "groupcontext": { 
        cid: "id"1d1d-r343-fgh5-1sdr",
        sbIdentifier: "<groupId>Test Group",
        "name"sbType: "<groupName>Group"
      },
     role:"admin/member",
     "activity":{
        "activityId":"<ActivityId>111d-r343-fgh5-1sdr",
        "activityName":"<ActivityName>Math's Course"
     } 
   }
}

  • Step 2: Flink job will receive the data from Kafka and group processor job will take the based on the value at service field.

  • Step 3: Processor job create the necessary template for the group operation action.type and create a notification api request object and call notification service api for processing.

Clarification needed

  • When DMW cache expired but user tried to do some actions then need to show one message. Also need message string : Manimegalai Mohan .

...