Use LVQ to run in Master/Slave mode
Hi, I wanted to run my service in 2 regions in master/slave mode. Is it possible to use an LVQ to achieve this? What I am thinking is that whenever the service starts it will try to connect to an LVQ and as per my understanding only one can have access to it. (Is it correct assumption?) If so, that process will act as a Master.
Comments
-
Hi @smpapas, we have customers using LVQs as "network sentinels" or voting mechanisms to determine who should be active. There's a feature of the APIs called Active Flow Indication which could be useful for you. How this works is the first application to bind is activated - it's "first past the post."
In this situation, though, you are operating across two regions. The LVQ will need to be in one region, so the application in the other region will need to have access to the other region. You can't guarantee which application will get access to the queue first, so you can't guarantee the application nearest to the broker where the LVQ is hosted will get activity.
You haven't told us if it is just this service or your entire infrastructure that you'd like to run like this. If it's your entire infrastructure, you could use Solace's DR features. You could use the health check service on the broker to determine if the broker is active, in which case this region is active and services could connect.
1 -
This our requirement: We are running our service in 2 cloud region and based on a scheduled time the service needs to do some actions (retrieve some data from db, process it, etc. and finally publish the result into a topic). Only once service is supposed to do these steps at a single point of time.
What I am thinking is that - the service (from both the regions) will send a message to an LVQ much before the actual scheduled time (say 15 min. before). So at the actual processing time only one message will be available in the LVQ and the service from each region will connect to that queue at the scheduled time and the service which receives the message will start the actual processing. (We have some limitations to run an external scheduler on cloud, that is why we are planning to use this approach) Do you see any issues with this approach?0 -
Hi @smpapas, no I think that would work. It could be simpler, though. I don't think there's any need to send the message to the LVQ. Just use the "active flow indication" to tell you which service should be active.
0 -
And @smpapas if your apps happen to be Spring Boot apps then you can even use this Spring Solace Leader Election starter that was contributed to the community. If not Spring Boot then ignore this
0