This project demonstrates a simple Vertx 4 project with three verticles deployed within the same Vertx instance.
Note: Running the application requires a running docker environment for the postgresql test container instance.
SampleTickVerticle
- Uses the VertxsetPeriodic
call to create a timer that simple outputs to stdout every 10 secondsHttpServerVerticle
- Creates a Vertx HTTP server with the following routes:GET /
- Responds with aHello from non-clustered vertx app
messagePOST /send/:message
- Extracts the string from the:message
path variable and delivers it to theMessageReceiverVerticle
via the Vertx event busGET /db
- Fetch all records from test PG databasePOST /db/:name
- Add a new row to test DB
MessageReceiverVerticle
- Receives messages from theHttpServerVerticle
via the event bus, and posts a reply back to the message senderVerticleMain
- Contains themain
method of the application and starts up the other three verticles.