Getting started using Virtual Threads
Understand the use of Java 21 and Virtual Threads on Rest, Batching and standalone apps.
Ignored
- Money transfer
- 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
- This service depends on risk-service and transfer-service.
git clone https://github.com/luizgustavocosta/virtual-threads.git
cd virtual-threads/bank-service
./mvnw spring-boot:run
mvn package
java -jar target/bank-service-0.0.1-SNAPSHOT.jar
The versions are available here.
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"
}'
curl -X 'GET' \
'http://localhost:8080/v1/transfers/parallel' \
-H 'accept: */*'
curl -X 'GET' \
'http://localhost:8080/v1/transfers/concurrent' \
-H 'accept: */*'
curl -X 'GET' \
'http://localhost:8080/v1/transfers/old-fashion' \
-H 'accept: */*'