noms-digital-studio/case-notes-poll-push

Name: case-notes-poll-push

Owner: NOMS Digital Studio

Description: Case Notes Pull Pusher

Created: 2017-03-30 08:07:31.0

Updated: 2017-08-23 09:02:05.0

Pushed: 2018-02-06 12:00:34.0

Homepage:

Size: 74

Language: Scala

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

case-notes-poll-push

Self-contained fat-jar micro-service to poll a source API for case notes and push to a target API.

Building and running

Prerequisites:

Build commands:

Running deployable fat jar:

Configuration parameters can be supplied via environment variables, e.g.:

Development notes

Developed in Scala 2.12, using Akka HTTP for HTTP client functionality, and Akka Actors to provide a highly scalable multi-threaded state machine.

The pull/push functionality is unit tested via dependency-injected mock APIs. The source and target REST APIs are also directly tested via WireMock HTTP Servers that mock the HTTP endpoints, and an integration test also connects to an embedded MongoDB server.

The implementation will be updated as reference source and target API environments become available.

Deployment notes

Requires access to a MongoDB database instance to store and retrieve the last processed time in case of a process or server restart, configurable via environment parameters:

A white-list of filtered noteType to be requested from the source can be set as a comma-separated list:

See Configuration.scala for a full list of configuration parameters.

Building and running with Docker

To run a Docker based integration test against mocked APIs and a real MongoDB instance:

Running against a mocked Delius instance

Run wiremock standalone and configure for Delius mock endpoint

Generating suitable keys

Use the whole output, as is, including header and line breaks if you like


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.