Public | Automated Build

Last pushed: 9 days ago
Short Description
write/ internal read of up memberships to neo4j
Full Description

Memberships Reader/Writer for Neo4j (memberships-rw-neo4j)

An API for reading/writing memberships into Neo4j. Expects the memberships json supplied to be in the format
that comes out of the memberships transformer.

Installation

For the first time:

go get github.com/Financial-Times/memberships-rw-neo4j

or update:

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

Running

  1. Download the code.
  2. Build it:

     go install
    
  3. Download, install and start neo4j (otherwise the app will panic and exit).

  4. Run it:

     $GOPATH/bin/memberships-rw-neo4j --neo-url={neo4jUrl} --port={port} --batchSize=50 --timeoutMs=20
    

All arguments are optional, they default to a local Neo4j install on the default port (7474), application running on port 8080,
batchSize of 1024 and timeoutMs of 50. NB: the default batchSize is much higher than the throughput the instance data
ingester currently can cope with.

Updating the model

Use gojson against a transformer endpoint to create a person struct and update the
model.go file. NB: we DO need a separate identifier struct.

curl http://ftaps35629-law1a-eu-t:8080/transformers/memberships/g10e101c-dbcf-356f-929e-669573defa56

Building

This service is built and deployed via Jenkins. The build chain can be found at
JOBS-memberships-rw-neo4j.

The build works via git tags. To prepare a new release:

  1. update the version in the Modulefile, e.g. to 0.0.12.
  2. git tag that commit using git tag 0.0.12
  3. git push --tags

The deploy also works via git tag and you can also select the environment to deploy to.

Try it!

Note the data in the example (e.g. UUIDs) is not real.

View your data in the database

MATCH (m:Membership {uuid:"g10e101c-dbcf-356f-929e-669573defa56"}) RETURN m

Logging

The application uses logrus, the log file is initialised in main.go.
Logging requires an env app parameter, for all environments other than local logs are written to file.
When running locally, logging is written to console (if you want to log locally to file you need to pass in an env parameter
that is != local.)

Docker Pull Command
Owner
coco

Comments (0)