How to ensure single running process on a distributed environment

On a distributed environment I have many nodes running the same code.

I have a process that handles an event and I want to make sure it is only handled once.

What are the recomended solutions for this requirement?

Here are my options from the top of my head:

Using a message broker (RabbitMQ, ActiveMQ, Kafka).

for instance, creating only one queue for this message.

But I don't like adding another component to the stack.

I dont really like adding a message brokers to the stack just for process sync.

use quartz.

http://www.quartz-scheduler.org/documentation/quartz-2.x/configuration/ConfigJDBCJobStoreClustering .

But I need a shared...

Read More »

By: StackOverFlow - Sunday, 15 April

Related Posts

  • Older News
  • Multiple instances running Java / Tomcat within Azure App Service ASE StackOverFlow (Today) - We're seeing some weird things happen when running Tomcat / Java inside of an Azure App Service Environment. Let me start with some details: We're using an isolated App Service...
  • Exception in thread "main" java.lang.ExceptionInInitializerError? StackOverFlow (Today) - Exception in thread "main" java.lang.ExceptionInInitializerErrorat org.apache.geode.distributed.internal.membership.gms.Services.(Services.java:131)at org.apache.geode.distributed.internal.membership.gms.GMSMemberFactory.newMembershipManager(GMSMemberFactory.java:103)at org.apache.geode.distributed.internal.membership.MemberFactory.newMembershipManager(MemberFactory.java:90)at org.apache.geode.distributed.internal.ClusterDistributionManager.(ClusterDistributionManager.java:1027)at org.apache.geode.distributed.internal.ClusterDistributionManager.(ClusterDistributionManager.java:1061)at org.apache.geode.distributed.internal.ClusterDistributionManager.create(ClusterDistributionManager.java:554)at org.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:763)at org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:355)at org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:343)at org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:335)at org.apache.geode.distributed.DistributedSystem.connect(DistributedSystem.java:211)at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:219)at org.apache.geode.distributed.internal.DefaultServerLauncherCacheProvider.createCache(DefaultServerLauncherCacheProvider.java:52)at org.apache.geode.distributed.ServerLauncher.createCache(ServerLauncher.java:844)at org.apache.geode.distributed.ServerLauncher.start(ServerLauncher.java:762)at GemfireTest.main(GemfireTest.java:29)Caused by: java.lang.IllegalStateException: JGAddress.create() returned the wrong class: UUIDat org.jgroups.conf.ClassConfigurator.add(ClassConfigurator.java:95)at...
  • Exception in thread "main" org.apache.geode.GemFireConfigException: unable to create jgroups channel StackOverFlow (Yesterday) - public static void main(String[] args) throws NameResolutionException, TypeMismatchException, QueryInvocationTargetException, FunctionDomainException {ServerLauncher serverLauncher = new ServerLauncher.Builder().setMemberName("server1").setServerPort(40404).set("start-locator", "localhost[9090]").build();serverLauncher.start();Exception in thread "main" org.apache.geode.GemFireConfigException:unable to create jgroups channel atorg.apache.geode.distributed.internal.membership.gms.messenger.JGroupsMessenger.start(JGroupsMessenger.java:325)atorg.apache.geode.distributed.internal.membership.gms.Services.start(Services.java:157)atorg.apache.geode.distributed.internal.membership.gms.GMSMemberFactory.newMembershipManager(GMSMemberFactory.java:106)atorg.apache.geode.distributed.internal.membership.MemberFactory.newMembershipManager(MemberFactory.java:90)atorg.apache.geode.distributed.internal.ClusterDistributionManager.(ClusterDistributionManager.java:1027)atorg.apache.geode.distributed.internal.ClusterDistributionManager.(ClusterDistributionManager.java:1061)atorg.apache.geode.distributed.internal.ClusterDistributionManager.create(ClusterDistributionManager.java:554)atorg.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:763)atorg.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:355)atorg.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:343)atorg.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:335)atorg.apache.geode.distributed.DistributedSystem.connect(DistributedSystem.java:211)at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:219)atorg.apache.geode.distributed.internal.DefaultServerLauncherCacheProvider.createCache(DefaultServerLauncherCacheProvider.java:52)atorg.apache.geode.distributed.ServerLauncher.createCache(ServerLauncher.java:844)atorg.apache.geode.distributed.ServerLauncher.start(ServerLauncher.java:762)at GemfireTest.main(GemfireTest.java:30) Caused by:java.lang.IllegalArgumentException: the...