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
- Host: GitHub
- URL: https://github.com/akaliutau/vertx-stepcounter
- Owner: akaliutau
- Created: 2021-05-17T13:07:14.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-18T14:23:04.000Z (about 5 years ago)
- Last Synced: 2025-02-28T10:55:22.462Z (over 1 year ago)
- Topics: java, kafka, vertx-web, vertx4
- Language: Java
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](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)