This example can be used to distributed processing in JAVA when you need asyncronous multi thread worker pattern., having:
- Vert.x Worker threads verticle example
- SpringBoot Liquebase, init DB data migration when container deploying.
- SpringBoot Actuator, process status check
- Vert.x SpringBoot JPA example, SQL.
- Vert.x SpringBoot with Mybatis, SQL.
- liquibase DB migration to DataBase(H2 or MariaDB) when instance have deployed
- Migration Status Check at Spring Actuator
- Rest API Check to Vert.x Facade verticle (Request & Response)
- Check worker thread logging in console logging. (initial set : worker verticle instance 4, Event Loop : 6 )
- Check Mybatis sql logging
port | Description |
---|---|
8989 | Vert.x communication port, it is used when communicate to Facade normal verticle which works request and response to client |
9000 | Springboot embeded port, it is used when mybatis jdbc connection pool |
7979 | Springboot actuator port, it is used service instance monitoring |
mvn clean spring-boot:run -P h2local
or, you can build to profile mariadb after change application.properties in mariadb profile
mvn clean spring-boot:run -P mariadb
id : bookexample, pw : 1234
http://localhost:7979/actuator
http://localhost:7979/actuator/liquibase
In console log, you can see different worker thread works in concrete class instance works as [worker-thread-0] ~ [worker-thread-8]
- book list search
curl --request GET --url http://localhost:8989/book/list
- book add
curl -X POST http://localhost:8989/book/add
-d '{
"name":"marble comics",
"author":"marble",
"pages":987
}'
- book search one
curl -X GET http://localhost:8989/book/id/1
- book delete
curl -X DELETE http://localhost:8989/book/delete/2