An open API service indexing awesome lists of open source software.

https://github.com/akaliutau/vertx-stepcounter

Step counter microservice with Kafka as a data source, Postgres as a persistence layer and a Vert.x as a basis for microservice
https://github.com/akaliutau/vertx-stepcounter

java kafka vertx-web vertx4

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

          

[![Generic badge](https://img.shields.io/badge/vert.x-4.0.3-purple.svg)](https://vertx.io)

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
==========

* [Vert.x Documentation](https://vertx.io/docs/)
* [Vert.x Stack Overflow](https://stackoverflow.com/questions/tagged/vert.x?sort=newest&pageSize=15)
* [Vert.x Initializr](http://start.vertx.io)