Skip to content

Latest commit

 

History

History
100 lines (83 loc) · 2.2 KB

README.md

File metadata and controls

100 lines (83 loc) · 2.2 KB

Project title

Getting started using Virtual Threads

Motivation

Understand the use of Java 21 and Virtual Threads on Rest, Batching and standalone apps.

Quality Gate

Ignored

Features

  • Money transfer

Run locally

Docker

  • This service depends on risk-service and transfer-service to run, not to be built as Docker image.
git clone https://github.com/luizgustavocosta/virtual-threads.git
cd virtual-threads/bank-service
mvn package
docker build -t virtual-threads/bank-service .
docker run -p 8080:8080 virtual-threads/bank-service

Command line

  • This service depends on risk-service and transfer-service.
git clone https://github.com/luizgustavocosta/virtual-threads.git
cd virtual-threads/bank-service

Option 1

./mvnw spring-boot:run

Option 2

mvn package 
java -jar target/bank-service-0.0.1-SNAPSHOT.jar

Languages and Tools:

           

The versions are available here.

Architecture:

Money transfer

img.png

APIS:

Swagger API Actuator

Examples

Transfer

curl -X 'POST' \
  'http://localhost:8080/v1/transfers' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "amount": "42.99",
  "from": "1234-5678",
  "to": "9012-3456",
  "device": "laptop"
}'

Parallel

curl -X 'GET' \
  'http://localhost:8080/v1/transfers/parallel' \
  -H 'accept: */*'

Concurrent

curl -X 'GET' \
  'http://localhost:8080/v1/transfers/concurrent' \
  -H 'accept: */*'

Old fashion

curl -X 'GET' \
  'http://localhost:8080/v1/transfers/old-fashion' \
  -H 'accept: */*'