GithubHelp home page GithubHelp logo

bhanditz / rest-prime-number-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from singhkua/rest-prime-number-generator

0.0 2.0 0.0 46 KB

RESTful service that calculates prime numbers

Java 100.00%

rest-prime-number-generator's Introduction

rest-prime-number-generator

RESTful service that calculates prime numbers. The service generates prime number with upper range upto 2^63-1. Long.MAX_VALUE

The service has been developed using Java 8 and Spring Boot Web and runs on port 8080. Clone the repository. The build tool is maven. Assuming maven is installed and is present in classpath, command "mvn clean install" will create the jar in the target folder. Command "java -jar target/rest-prime-number-generator-0.0.1-SNAPSHOT.jar" will make the tomcat to listen to http requests at port 8080.

This project consists of Swagger. This url - http://localhost:8080/swagger-ui.html, will provide all the api methods.

http://localhost:8080/swagger-ui.html#!/primes-controller/generatePrimesUsingGET will trigger an async request to generate the prime numbers. This request will receive a request uuid in response which can be used to get the prime results.

The service caches the prime results for 3 hours.

It implements various strategies to generate prime numbers which can be looked up using http://localhost:8080/api/v1/primes/strategyNames "FORK_JOIN", "ITERATIVE", "PARALLEL_STREAM", "STREAM", "ERATOSTHENES_SIEVE"

The unit tests cases has been written using TestNG and Mockito. TestNG is to test the algorithms/methods of prime generation. Mockito has been used to test the primes service

rest-prime-number-generator's People

Contributors

singhkua avatar

Watchers

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