- Part 1: Headache-Free Reactive Programming With Spring Boot and Kotlin Coroutines:
- Part 2: Headache-Free Reactive Programming With Spring Boot and Kotlin Coroutines - Adding Virtual Threads to the mix
- Install openjdk 21
- See instructions at:
https://github.com/americanexpress/baton
- Add
~/.curl-format.txt
with the following content:TOTAL TIME: %{time_total}s\n ===========================\n```
- in
!/.bash_profile
add the following entry:alias curltime="curl -w \"@$HOME/.curl-format.txt\" -o NUL -s "
- source
~/.bash_profile
For the samples to run, we need to talk to a remote server.
- Go to the folder
node-server
- execute:
build.sh
- execute:
run.sh
- Disable Virtual Threads:
spring.threads.virtual.enabled=true
curl -X POST -H "Content-Type: application/json" -d '{"id":null,"userName":"Jack","email":"[email protected]","avatarUrl":null}' http://localhost:8085/blocking/users\?delay\=200 | jq
curltime -X POST -H "Content-Type: application/json" -d '{"id":null,"userName":"Jack","email":"[email protected]","avatarUrl":null}' http://localhost:8085/blocking/users\?delay\=200
baton -m POST -u http://localhost:8085/blocking/users?delay=2000 -z users-blocking.csv -c 100 -r 110
curl -X POST -H "Content-Type: application/json" -d '{"id":null,"userName":"Jack","email":"[email protected]","avatarUrl":null}' http://localhost:8085/reactorj/users\?delay\=200 | jq
curltime -X POST -H "Content-Type: application/json" -d '{"id":null,"userName":"Jack","email":"[email protected]","avatarUrl":null}' http://localhost:8085/reactorj/users\?delay\=200
baton -m POST -u http://localhost:8083/reactorj/users?delay=2000 -z users-reactive.csv -c 100 -r 110
curl -X POST -H "Content-Type: application/json" -d '{"id":null,"userName":"Jack","email":"[email protected]","avatarUrl":null}' http://localhost:8085/users\?delay\=200 | jq
curltime -X POST -H "Content-Type: application/json" -d '{"id":null,"userName":"Jack","email":"[email protected]","avatarUrl":null}' http://localhost:8085/users\?delay\=200
baton -m POST -u http://localhost:8085/users?delay=2000 -z users-coroutines.csv -c 100 -r 110
- Enable Virtual Threads:
spring.threads.virtual.enabled=true
curl -X POST -H "Content-Type: application/json" -d '{"id":null,"userName":"Jack","email":"[email protected]","avatarUrl":null}' http://localhost:8085/blocking/users\?delay\=200 | jq
curltime -X POST -H "Content-Type: application/json" -d '{"id":null,"userName":"Jack","email":"[email protected]","avatarUrl":null}' http://localhost:8085/blocking/users\?delay\=200
baton -m POST -u http://localhost:8085/blocking/users?delay=2000 -z users-blocking.csv -c 100 -r 110