A Java VERT.X based web app template that provides a web/api front end for handling requests, that then get handled by long running processes. Effectively, an order taking API..
General Processing Flow
- VerticleLauncher started, creates all worker and standard verticles.
- A standard Vertx web handler Verticle listens for incoming requests.
- The handler listens for various URI and upon receipt, starts a few CompletableFutures to vertx messagebus send the respective parts of the posted request to other vertx workers.
- CompetableFutures, using .allOf/.whenComplete, join the replies from the Workers to signify completion.
For this project, a 'coffee-shop' flow is simulated..
- User submits an order request to front line cashier.
- Cashier takes order, and submits request to a Barista and Kitchen Worker respectively.
- Cashier provides unque id reply to user.
- Barista and Kitchen Worker processes requests in parallel. Long Running Processes
- When both are complete, a package order is submitted to the Line Worker.
- Line Worker receives order to package, and processes Long Running Process
- Line Worker places finished order on counter for pickup
Compile using:
mvn clean compile
Package fat jar using:
mvn package
Deploy to API Gateway
serverless deploy