Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 2 days 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 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-27T16:59:48.000Z (6 months ago)
- Last Synced: 2024-11-08T05:04:33.884Z (about 2 months ago)
- Topics: dropwizard, java, micronaut, quarkus, spring-boot, test-containers
- Language: Java
- Homepage:
- Size: 320 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
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 accountsRequest Body:
```
N/A
```Response Body:
```json
[
{
"id": 1,
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "2000-03-17",
"currency": "USD",
"moneyAmount": 78
}
]
```
GET
/accounts/{id}
- Get account by IDRequest Body:
```
N/A
```Response Body:
```json
{
"id": 1,
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "2000-03-17",
"currency": "USD",
"moneyAmount": 78
}
```
POST
/accounts
- Create new accountRequest Body:
```json
{
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "2000-03-17",
"currency": "USD",
"moneyAmount": 78
}
```Response Body:
```json
{
"id": 1,
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "2000-03-17",
"currency": "USD",
"moneyAmount": 78
}
```
POST
/accounts/transfer
- Transfer money from one account to anotherRequest 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 ApiUser ->> 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
```