Versions Compared

Key

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

...

  • The DeviceRegister Service writes the device profile details into a device-profile.log file.

    Code Block
    languagetext
    themeRDark
    titledevice-profile.log
    {
    	"statecustomcodedevice_id": "29232455",
    	"countryuaspec": "India",{
    		"iso3166statecodeagent": "IN-KAChrome",
    		"device_idsystem": "232455Linux",
    	"uaspec": {
    		"agentver": "Chrome68.0.3440.75",
    		"raw": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36",
    		"system": "Linux",
    		"ver": "68.0.3440.75"
    	},
    	"city": "Bengaluru",
    	"countrycodecountry_code": "IN",
    	"state": "Karnataka", 	"statecodecountry": "KAIndia",
    	"api_last_updated_dateon": 1566383863167,
    	"devicespecdevice_spec": {
    		"os": "Android 6.0",
    		"make": "Motorola XT1706"
    	},
    	"districtcustomdistrict_custom": "",
    	"fcm_token": "asda",
    	"firstaccessfirst_access": 1565328282703,
        "state_code_custom": "29",
    	"statecustomname"state": "Karnataka",
    	"state_code": "KA",
    	"state_custom": "Karnataka",
    	"producer_id": "dev.sunbird.portal"
    }


  • Logstash will be configured to read from the log file and push the data into Kafka as an event.
  • A Secor process is run to take the device data from the Kafka topic and creates a backup.
  • DeviceProfileUpdater Samza job reads the Kafka event and:
       a) If device_id exists in cache, updates the cache and the existing device profile Cassandra DB.
       b) If device_id doesn't exist in cache, creates new entry in cache as well as Cassandra.

...