https://github.com/bitxon/java-microservices
Compare: Spring, Quarkus, Micronaut, Dropwizard
https://github.com/bitxon/java-microservices
dropwizard java micronaut quarkus spring-boot test-containers
Last synced: about 1 month ago
JSON representation
Compare: Spring, Quarkus, Micronaut, Dropwizard
- Host: GitHub
- URL: https://github.com/bitxon/java-microservices
- Owner: bitxon
- Created: 2022-08-13T09:00:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-25T12:06:39.000Z (about 1 year ago)
- Last Synced: 2025-01-25T12:24:48.233Z (about 1 year ago)
- Topics: dropwizard, java, micronaut, quarkus, spring-boot, test-containers
- Language: Java
- Homepage:
- Size: 320 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Java Microservices
- [Dropwizard](dropwizard-app/README.md)
- [Spring](spring-app/README.md)
- [Micronaut](micronaut-app/README.md)
- [Quarkus](quarkus-app/README.md)
# Description
This project is a comparison of Java frameworks.
All applications implement the same functionality and expose the same REST api
# Quick start
1. Build
- `./gradlew clean build`
2. Spin Up Postgres & Wiremock:
- `docker-compose up -d`
3. Start one of the Apps:
- `./run-dropwizard.sh`
- `./run-spring.sh`
- `./run-micronaut.sh`
- `./run-quarkus.sh`
4. Run Gatling:
- `./gradlew :loadtest:gatlingRun --simulation gatling.simulation.AppSimulation`
Check wiremock performance
1. Spin Up Wiremock:
- `docker-compose up -d wiremock`
4. Run Gatling:
- `./gradlew :loadtest:gatlingRun --simulation gatling.simulation.WiremockSimulation`
# Rest API
GET /accounts - Get all accounts
Request Body:
```
N/A
```
Response Body:
```json
[
{
"id": 1,
"email": "john@mail.com",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "2000-03-17",
"currency": "USD",
"moneyAmount": 78
}
]
```
GET /accounts/{id} - Get account by ID
Request Body:
```
N/A
```
Response Body:
```json
{
"id": 1,
"email": "john@mail.com",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "2000-03-17",
"currency": "USD",
"moneyAmount": 78
}
```
POST /accounts - Create new account
Request Body:
```json
{
"email": "john@mail.com",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "2000-03-17",
"currency": "USD",
"moneyAmount": 78
}
```
Response Body:
```json
{
"id": 1,
"email": "john@mail.com",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "2000-03-17",
"currency": "USD",
"moneyAmount": 78
}
```
POST /accounts/transfer - Transfer money from one account to another
Request Header: (is being used to fail operation and check that transaction works)
```
Dirty-Trick-Header: FAIL_TRANSFER
```
Request Body:
```json
{
"senderId": 1,
"recipientId": 2,
"moneyAmount": 100
}
```
Response Body:
```
N/A
```
Diagram:
```mermaid
sequenceDiagram
actor User as User
participant App as Application
participant DB as Database
participant Api as Bank Api
User ->> App: POST /transfer
activate App
App ->> DB: Find accounts
deactivate App
activate DB
DB -->> App: Accounts
deactivate DB
activate App
App ->> Api: GET /exchange
deactivate App
activate Api
Api -->> App: Exchange rate
deactivate Api
activate App
App ->> App: Update balance of accounts
App ->> DB: Save accounts
deactivate App
activate DB
DB -->> App: Done
deactivate DB
activate App
App -->> User: Done
deactivate App
```