The service is used for automated content exports. There are 3 types of export:
An INCREMENTAL export is started at the startup and the service starts consuming messages from Kafka ONLY if this functionality is enabled - see configuration.
Download the source code, dependencies and test dependencies:
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh # Install dep
go get -u github.com/Financial-Times/content-exporter
cd $GOPATH/src/github.com/Financial-Times/content-exporter
dep ensure -vendor-only
go build -v .
Run the tests and install the binary:
dep ensure -vendor-only
go test -v -race ./...
go install
Run the binary (using the help flag to see the available optional arguments):
$GOPATH/bin/content-exporter [--help]
Usage: content-exporter [OPTIONS]
Exports content from DB and sends to S3
Options:
--app-system-code="content-exporter" System Code of the application ($APP_SYSTEM_CODE)
--app-name="content-exporter" Application name ($APP_NAME)
--port="8080" Port to listen on ($APP_PORT)
--mongoConnection="" Mongo addresses to connect to in format: host1:port1,host2:port2,...] ($MONGO_CONNECTION)
--enrichedContentBaseURL="http://localhost:8080" Base URL to enriched content endpoint ($ENRICHED_CONTENT_BASE_URL)
--enrichedContentHealthURL="http://localhost:8080/__gtg" Health URL to enriched content endpoint ($ENRICHED_CONTENT_HEALTH_URL)
--s3WriterBaseURL="http://localhost:8080" Base URL to S3 writer endpoint ($S3_WRITER_BASE_URL)
--s3WriterHealthURL="http://localhost:8080/__gtg" Health URL to S3 writer endpoint ($S3_WRITER_HEALTH_URL)
--xPolicyHeaderValues="" Values for X-Policy header separated by comma, e.g. INCLUDE_RICH_CONTENT,EXPAND_IMAGES ($X_POLICY_HEADER_VALUES)
--authorization="" Authorization for enrichedcontent endpoint, needed only when calling the endpoint via Varnish ($AUTHORIZATION)
--kafka-addr="" Comma separated kafka hosts for message consuming. ($KAFKA_ADDRS)
--group-id="" Kafka qroup id used for message consuming. ($GROUP_ID)
--topic="" Kafka topic to read from. ($TOPIC)
--delayForNotification=30 Delay in seconds for notifications to being handled ($DELAY_FOR_NOTIFICATION)
--whitelist="" The whitelist for incoming notifications - i.e. ^http://.*-transformer-(pr|iw)-uk-.*\.svc\.ft\.com(:\d{2,5})?/content/[\w-]+.*$ ($WHITELIST)
--logDebug=false Flag to switch debug logging ($LOG_DEBUG)
--maxGoRoutines=100 Maximum goroutines to allocate for kafka message handling ($MAX_GO_ROUTINES)
--contentRetrievalThrottle=0 Delay in milliseconds between content retrieval calls
3. Test:
curl http://localhost:8080/__health
HTTP Endpoints are only for FULL and TARGETED exports
/export - Triggers an export. If ids is in the json body request, then a TARGETED export is triggered, otherwise a FULL export/jobs - Returns all the running jobs/jobs/{jobID} - Returns the job specified by the jobID parameterAdmin endpoints are:
/__gtg
/__health
/__build-info
There are several checks performed:
Content type
Image
Digest
sha256:a351022d6…
Size
7.8 MB
Last updated
2 days ago
docker pull coco/content-exporter