Public | Automated Build

Last pushed: a month ago
Short Description
content-rw-neo4j
Full Description

Content Reader/Writer for Neo4j (content-rw-neo4j)

An API for reading/writing Content into Neo4j. Expects the content json supplied by the ingester.

Installation

go get -u github.com/Financial-Times/content-rw-neo4j

Running

$GOPATH/bin/content-rw-neo4j \
   --neo-url={neo4jUrl} \
   --port={port} \
   --batchSize=50 \
   --graphiteTCPAddress=graphite.ft.com:2003 \
   --graphitePrefix=content.{env}.content.rw.neo4j.{hostname} \
   --logMetrics=false

All arguments are optional, please run the following command to see the defaults:

$GOPATH/bin/content-rw-neo4j --help

Building

The application is continuously built by CircleCI.

The docker image of the service is built by Dockerhub based on the git release tag.

To prepare a new git release, go to the repo page on GitHub and create a new release.

Updating the Model

Currently we use a subset of the fields that we get from the Ingester but if more fields are needed to be pulled in then update the model.go

The flow of information is as follows: Kafka (CMSPublication) => Ingester => content-rw-neo4j

Content Types

Currently, the following content types are eligible for being written into Neo:

  • Article
  • Content
  • Video

Additionally, any content payloads which contain a body property, will be written to Neo.

API

Write content to Neo4j:

curl http://localhost:8080/content/:uuid -XPUT -H'Content-Type: application/json' --data '{"uuid":":uuid","body":"<body></body>"}'

Read content from Neo4j:

curl http://localhost:8080/content/:uuid'

Count content in Neo4j:

curl http://localhost:8080/content/__count'

Delete content from Neo4j:

curl http://localhost:8080/content/:uuid -XDELETE '

Please see the OpenAPI spec for details.

Docker Pull Command
Owner
coco