I have a Vert.x application with several verticls to interact with different buses and dbs (mongo, redis, rabbit, kafka and such)
among those there is a verticle dedicated for communication with external api (very old) which allow for one persistent connection and from a single (pre defined) source
I'm deploying mutli instances of vertx with the same code (auto-scale) and make them act as a cluster, using hazelcast as a cluster manager
what is the best practice for limiting the creation of the external-api verticle to only single instance, I looked at:
SharedData.Lock()- but I'll need to wrap it with an async spinning lock logicHigh Availability- great for termination and auto-scaling but doesn't force activity of a single verticleworker verticle- to create 1 worker verticle in each instance
I could use a mix of all the above and create the desired functionality, but I seems some what complex...
should I separate my verticle to a different server or there is some simpler solution I haven't thought of yet?
SharedData.Lock()would let you create a dedicated connection to your legacy api, but of course it won't forbid create multiple instances of the same verticle. - injecteer