To run WorkHttpApp
sbt "runMain agh.reactive.routers_demo.WorkHttpApp 9123"
Simple curl to test WorkHttpApp
curl -X POST \
http://localhost:9123/work \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"work": "some work to do"
}'
See: application.conf
file
First setup node cluster:
# first create ClusterWorkRouters cluster
sbt "runMain agh.reactive.routers_demo.ClusterNodeApp seed-node1" &
sbt "runMain agh.reactive.routers_demo.ClusterNodeApp seed-node2" &
sbt "runMain agh.reactive.routers_demo.ClusterNodeApp" & #just the node on random port
Then run separate server HTTP instances with configured Pool router
# starting http servers which will also create routers with workers deployed on previously configured cluster
sbt "runMain agh.reactive.routers_demo.WorkHttpClusterApp 9001" &
sbt "runMain agh.reactive.routers_demo.WorkHttpClusterApp 9002" &
sbt "runMain agh.reactive.routers_demo.WorkHttpClusterApp 9003" &
(see: https://gatling.io/docs/current/quickstart/)
To start basic gatling performance test, run:
sbt gatling-it:test
To open last report:
sbt gatling-it:lastReport
Use to be sure that you've killed every instance of sbt
ps ax | grep sbt | awk '{print $1}' | xargs kill -9