Git Product home page Git Product logo

delius-api-pollpushpoke's Introduction

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

delius-api-pollpushpoke's People

Contributors

llmikeyj avatar

Watchers

James Cloos avatar Nick Talbot avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.