Skip to content

Step counter microservice with Kafka as a data source, Postgres as a persistence layer and a Vert.x as a basis for microservice

Notifications You must be signed in to change notification settings

akaliutau/vertx-stepcounter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generic badge

About

This is a simple server application which implements a simple CRUD service with Postgres as a backend and reactive API, built on the basis of Vert.x framework

Demonstrates the using of the following technologies:

  • Apache Kafka as a source of data to persist

  • Exposing public end points to access the data saved in the database

  • Test containers for integration tests

public api:

Method Endpoint Secure Description
GET /deviceId/total No value of counter for specific device
GET /deviceId/year/month No value of counter for specific month on device
GET /deviceId/year/month/day No value of counter for specific day on device

Building

To launch your tests:

mvn clean test

To package your application:

mvn clean package

To run your application:

java -cp ./target/vxcore-1.0.0-SNAPSHOT-fat.jar verticle.StepServer 

Run all containers, then create a record in step table with device_id=1

Perform the GET request to the following endpoint:

GET http://localhost:3001/1/total

{"count":123}

Reference

About

Step counter microservice with Kafka as a data source, Postgres as a persistence layer and a Vert.x as a basis for microservice

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published