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

Kafka topic from which messages/events are read to be processed.

kafka.output.failed.topic

{{env}}.learning.events.failed

Kafka topic to which message is written when an exception occurs while processing an event.

kafka.groupId

Kafka input topic group Id

kafka.output.course.batch.updater.topic

{{env}}.coursebatch.job.request

Kafka topic to which output message/event is inserted to perform user course progress activity reconciliation to merged Id

lms-cassandra.keyspace

sunbird_courses

Cassandra keyspace name

lms-cassandra.content_consumption.table

user_content_consumption

Cassandra table used to store content wise data for a collection of a batch by a user. Content progress, status etc

lms-cassandra.user_enrolments.table

user_enrolments

Cassandra 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.table

user_activity_agg

Cassandra 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:

Last updated