Content publish

🌠 Content-publish

The Job serves as a critical component for publishing content/collection objects submitted for publishing within the system. It fulfils various essential functions to ensure a seamless and efficient publishing process:

  1. Download and ECAR Packaging: The Job is responsible for downloading media files and packaging them into ECAR (E-content Archive) format, enabling offline consumption of content.

  2. Collection Hierarchy Publishing: It handles the publishing of updated or edited collection hierarchy data, ensuring that changes are correctly reflected in the published content.

  3. Metadata Update: The Job updates the metadata of content/collection object nodes with essential publish information, including ECAR paths, versionKey, pkgVersion, streamingUrl, status, and other relevant details.

  4. Elastic Search Indexing: For efficient search and retrieval, the Job indexes collection leaf node objects to Elastic Search, enabling streamlined access to content data.

  5. Redis Cache Clearing: To maintain data integrity and consistency, the Job clears cached node data from Redis, ensuring that users always access up-to-date information.

  6. Output Topics: The Job generates output topics for post-publish processing, video stream generation (if streaming is enabled and the content is of streamable mimeType)

By performing these essential functions, the Job plays a crucial role in ensuring the successful and accurate publishing of content/collection objects. It ensures that published content is properly packaged, metadata is updated, indexing is efficient, and caches are cleared for optimal user experience. Ultimately, the Job contributes to a robust and reliable publishing process within the system.



During the deployment process, the configuration for all knowledge-platform-jobs is sourced from the sunbird-learning-platform repository. On the other hand, for local setups, the configuration is taken from the respective job folders within the knowledge-platform-jobs repository.

Kafka Topic:

kafka {
      input.topic = {{ env_name }}.publish.job.request
      groupId = {{ env_name }}-content-publish-group

Job configuration variables:



Used to specify local/server folder location where artifacts are to be downloaded for ECAR bundling. Default value: "/data/contentBundle/"


Used to specify if the ECAR extraction is to be enabled to object 'version' and 'latest' cloud location using its 'snapshot' version. Default value: true


Used to specify number of times download attempt for assets part of content/collection object is to be done till it is successfully downloaded. Default value: 1




Used to specify list of valid objectTypes supported for publishing. Default value: ["Content", "ContentImage"]


Used to specify list of valid mimeTypes supported for publishing. Default value: ["application/pdf"]


Used to specify time in seconds to wait for the asset download request to respond. Default value: "60 seconds"

Used to check if streaming is enabled for published objects. If it is enabled, content rendenring is done using 'streamingUrl' attribute else via 'artifactUrl' Default value: false

Used to check if the mimeType of the object being published is of streamable type. If yes, event for video-stream-generator job is generated. Default value: ["video/mp4"]


Used to set the maximum size of the object (in bytes) that can be played by downloading beyond which "contentDisposition" is set to "online-only". Default value: 209715200


Used to specify list of attributes that store asset Urls which are to be downloaded from the mentioned Urls while packaging SPINE ECAR. Default value: ["appIcon"]


Used to specify list of attributes that store asset Urls which are to be downloaded from the mentioned Urls while packaging FULL ECAR. Default value: ["appIcon", "grayScaleAppIcon", "artifactUrl", "itemSetPreviewUrl", "media"]


Used to specify the list of object properties that are of object types with nested attributes. Default value: ["badgeAssertions","targets","badgeAssociations"]


Used to specify the cloud store container folder name for content file storage/extraction etc. Default value: "container"


Used to specify the cloud store container folder name for artifact (media) files storage. Default value: "artifact"


Used to specify the mapping between contentType and primaryCategory attributes using which object metadata is populated with the missing attribute among two. Default value: []

Used to specify the composite search index name where collection object nodes are synced with updated metadata. Default value: "compositesearch"


Used to specify the ElasticSearch document index type using which collection object nodes are synced with updated metadata. Default value: "cs"


Used to specify whether object getting published is to be enriched with framework metadata. Default value: "Yes"




Used to specify the list of file extensions allowed for uploaded content object. Default value: ["doc", "docx", "ppt", "pptx", "key", "odp", "pps", "odt", "wpd", "wps", "wks"]


Used to sepcify if the DIAL code context update data is to be computed using the linked/de-linked Dial codes of the content/collection.

Sample Kafka event:

  "eid": "BE_JOB_REQUEST",
  "ets": 1619527882745,
  "mid": "LP.1619527882745.32dc378a-430f-49f6-83b5-bd73b767ad36",
  "actor": {
    "id": "content-publish",
    "type": "System"
  "context": {
    "channel": "01309282781705830427",
    "pdata": {
      "id": "org.sunbird.platform",
      "ver": "1.0"
    "env": "dev"
  "object": {
    "id": "do_11329603741667328018",
    "ver": "1619153418829"
  "edata": {
    "publish_type": "public",
    "metadata": {
      "identifier": "do_11329603741667328018",
      "mimeType": "application/pdf",
      "objectType": "Content",
      "lastPublishedBy": "",
      "pkgVersion": 1
    "action": "publish",
    "iteration": 1


Services: Content Service - composite search API

Jobs: 'post-publish-processor', 'video-stream-generator' & 'mvc-indexer'

Last updated