Today building platforms is extremely quick with JPA, Guice, JSR 303 bean validation. It’s rather easy to whip something up.
Let’s say I was using Guice and I had a poller process as a singleton within a cluster of JVM machines. How could I easily make it so
- when the cluster started up(3 machines), that only one started the singleton up
- When the machine with the running singleton failed, one of the other machines started up the singleton
This can’t be too hard with today’s libraries out there, right? The more I look, I think jgroups is the answer but would like to hear from others(Jboss uses jgroups from what I have seen so far).
I would go for hazelcast and distributed locking, have a look at Hazelcast and Singleton.
Probably terracotta can do the trick as well.