Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

A tactical solution to provide simulated external access to delius APIs. The other half of delius-api-job-schedular

Notifications You must be signed in to change notification settings

noms-digital-studio/delius-api-pollpushpoke

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

delius-api-pollpushpoke

Self-contained fat-jar micro-service to poll a source API for delius API jobs, push to a target API, and POST back to the job scheduler It is a pretty horrid tactical solution to problems of network access. It is also a POC.

Building and running

Prerequisites:

Build commands:

  • Build and run tests sbt test
  • Run locally sbt run
  • Build deployable pollPush.jar sbt assembly

Running deployable fat jar:

  • java -jar icbind-0.1.jar

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

  • POLL_SECONDS=10 sbt run
  • POLL_SECONDS=10 java -jar icbind-0.1.jar

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.poke 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.

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

Deployment notes

Configurable via environment parameters:

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

Running against a mocked Delius instance

Run wiremock standalone and configure for Delius mock endpoint

  • Download wiremock standalone: http://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-standalone/2.6.0/wiremock-standalone-2.6.0.jar

  • Override the Delius endpoint PUSH_BASE_URL=http://localhost:8085/delius java -jar pollPush.jar

  • Start wiremock java -jar wiremock-standalone-2.6.0.jar --port 8085 &

  • Configure wiremock endpoint curl -X POST -d @./src/test/resources/mappings/{mapping file}.json http://localhost:8085/__admin/mappings

About

A tactical solution to provide simulated external access to delius APIs. The other half of delius-api-job-schedular

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages