I am developing microservices using vertx4 and each service is composed of multiple verticles and all are deployed as clustered(hazelcast) verticle using below code.
Vertx.clusteredVertx(options.setHAEnabled(isHa), (vertx) -> {
((Vertx)vertx.result()).deployVerticle(verticleName, (new DeploymentOptions()));
});
I am calling above code for each verticle in a service and multiple vertx object or instance is created.
- Is it correct way deploy verticles in cluster?
- Should I get one vertx object from clusteredVertx and use it deploy multiple verticles?
- What would be the advantage and disadvantage of having multiple vertx instance?
I have gone through the vertx documentation but I am not able to understand clustering particularly. I even checked some of vertx source codes like Launcher
class but nothing helped me to get answers.