Public | Automated Build

Last pushed: 6 months ago
Short Description
Listens to kafka, gets videos, transforms them to Content, puts them back to kafka.
Full Description


Listens to kafka(-bridge) NativeCmsPublicationEvents, gets videos, transforms them to Content, puts them back to kafka(-bridge) to CmsPublicationEvents.

Binary run

export Q_ADDR="" ## you'll have to change the address to your queue
export Q_GROUP=videoMapper
export Q_READ_TOPIC=NativeCmsPublicationEvents
export Q_READ_QUEUE=kafka
export Q_WRITE_TOPIC=CmsPublicationEvents
export Q_WRITE_QUEUE=kafka
export Q_AUTHORIZATION=$(etcdctl get /ft/_credentials/kafka-bridge/authorization_key) ## this is not exact, you'll have to get it from the cluster's etcd
go build

Docker build

docker built -t video-mapper .

Run with docker example

export Q_AUTHORIZATION=$(etcdctl get /ft/_credentials/kafka-bridge/authorization_key)

docker run -p 8080 \
    --env "Q_ADDR=" \
    --env "Q_GROUP=videoMapper" \
    --env "Q_READ_TOPIC=NativeCmsPublicationEvents" \
    --env "Q_READ_QUEUE=kafka" \
    --env "Q_WRITE_TOPIC=CmsPublicationEvents" \
    --env "Q_WRITE_QUEUE=kafka" \

Verify the mapping logic via HTTP

Take a native video json format from this gist
Just the JSON, not the headers.

HTTP POST it to this app's /map endpoint.

You should receive a response body like:

  "contentUri": "",
  "payload": {
    "uuid": "bad50c54-76d9-30e9-8734-b999c708aa4c",
    "identifiers": [
        "authority": "",
        "identifierValue": "4492075574001"
    "publishedDate": "2016-04-29T11:02:58.000Z",
    "mediaType": "video/mp4",
    "publishReference": "tid_123123",
    "lastModified": "2016-04-29T11:02:58.269Z"
  "lastModified": "2016-04-29T11:02:58.269Z",
  "canBeDistributed": "yes"

This is just for verification, does not send the message to any queue.

Docker Pull Command
Source Repository

Comments (0)