Code Monkey home page Code Monkey logo

spring-boot-polling's Introduction

HTTP Endpoints

/latestRate

Returns the latest exchange rate by creation date

/historyRates?startDate=yyyy-MM-dd'T'HH:mm:ss.SSSZ&endDate=yyyy-MM-dd'T'HH:mm:ss.SSSZ

Gets all exchange rates between the startDate and the endDate in JSON.

Both endpoints '/historyRates' and '/historyRateStream' do the nearly same thing. This one simply produces a string response. It first gets all data from the database and subsequently turns them into a JSON string.

Both parameters, startDate and endDate, are in the ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g. "2000-10-31T01:30:00.000-05:00" although the milliseconds and timezone can be omitted and a valid request could be /historyRates?startDate=2017-02-26T15:40:00&endDate=2017-02-26T20:19:00

/historyRateStream?startDate=yyyy-MM-dd'T'HH:mm:ss.SSSZ&endDate=yyyy-MM-dd'T'HH:mm:ss.SSSZ

Gets all exchange rates between the startDate and the endDate in JSON.

Both endpoints '/historyRates' and '/historyRateStream' do the nearly same thing. The difference with this one is that it produces a chunked HTTP response that is like a stream. The HTTP response starts being transfered before all data is retrieved from the database. Use this endpoint if you expect the returned data to be rather big.

Both parameters, startDate and endDate, are in the ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g. "2000-10-31T01:30:00.000-05:00" although the milliseconds and timezone can be omitted and a valid request could be /historyRateStream?startDate=2017-02-26T15:40:00&endDate=2017-02-26T20:19:00

Run

mvn spring-boot:run

Test

mvn test

Technology

It uses Spring Boot, Spring MVC, Spring Data, Maven, an embedded MongoDB, and Logback.

External configuration is done via the 'application.properties'.

It also activates scheduling that is used by class EuroDollarExchangeRateChecker to poll exchange rates from a public Rest service.

This application uses Spring Data with an embedded MongoDB - but with Spring Data the database can be easily switched to a different one.

spring-boot-polling's People

Contributors

kristian-lange avatar

Watchers

James Cloos avatar  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.