Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 3.21 KB

File metadata and controls

57 lines (45 loc) · 3.21 KB

Merge User Courses

'merge-user-courses' job will permit a user who owns multiple accounts on a sunbird platform (one on an Organisation tenant and one on the custodian tenant), to merge the course related usage history (course batch enrolments, course content consumption, course progress) into one primary account.

This job performs following tasks:

  • Merges the content consumption details from an account to primary account.
  • Merges the user batches from an account to primary account.
  • Merges the user activity aggregate data from an account to primary account.
  • Performs a batch-enrolment-sync to primary account

Configuration variables:

VariableDefault ValuePurpose
kafka.input.topic{{env}}.lms.user.account.mergeKafka topic from which messages/events are read to be processed.
kafka.output.failed.topic{{env}}.learning.events.failedKafka topic to which message is written when an exception occurs while processing an event.
kafka.groupIdKafka input topic group Id
kafka.output.course.batch.updater.topic{{env}}.coursebatch.job.requestKafka topic to which output message/event is inserted to perform user course progress activity reconciliation to merged Id
lms-cassandra.keyspacesunbird_coursesCassandra keyspace name
lms-cassandra.content_consumption.tableuser_content_consumptionCassandra table used to store content wise data for a collection of a batch by a user. Content progress, status etc
lms-cassandra.user_enrolments.tableuser_enrolmentsCassandra table used to store user enrolment data in a collection of a particular batch. This also holds the consumption progress, enrolment status and issued certificate details
lms-cassandra.user_activity_agg.tableuser_activity_aggCassandra table used to store user consumption aggregate details of a collection in a batch. Aggregates like the consumption completed content count

Sample event:

{
  "eid": "BE_JOB_REQUEST",
  "ets": 1648720639981,
  "mid": "LP.1648720639981.d6b1d8c8-7a4a-483a-b83a-b752bede648c",
  "actor": {
    "id": "Merge User Courses and Cert",
    "type": "System"
  },
  "context": {
    "pdata": {
      "ver": "1.0",
      "id": "org.sunbird.platform"
    },
    "channel": "0123221758376673287017",
    "env": "staging"
  },
  "object": {
    "type": "MergeUserCoursesAndCert",
    "id": "68b764efd14bb3b534984649"
  },
  "edata": {
    "action": "merge-user-courses-and-cert",
    "fromAccountId": "b964d83a-c40f-4b3c-85e7-68b764efd14b",
    "toAccountId": "191e6b5a-8581-46bd-b779-b3b534984649",
    "rootOrgId": "0123221758376673287017",
    "iteration": 1
  }
}

Source Code:

{% embed url="https://github.com/Sunbird-Lern/data-pipeline/tree/release-5.3.0/lms-jobs/merge-user-courses" %}