11 Replies Latest reply on Feb 22, 2011 11:38 AM by Galder Zamarreño

    Locking strategy suggestion

    Lin Ye Novice

      In our product, we use Fuse ESB, and its cluster for redundancy and load balancing. When an event is generated on the bus, all the subscribers across the cluster would get the event. However, we expect only one subscriber in the cluster to handle any particular event, and are planning to use the Infinispan cluster-wide lock to support it. Basically, only the instance, which acquires the cluster-wide lock, could proceed to process the event. However, when all subscribers get the event around the same time and race for the lock, they may all fail to get the lock with timeout, as each of them acquires the local lock but fails to get locks on remote instances. What strategy would be recommended for this use case, when multiple instances race for the same lock at the same time, and we expect one of them to get the lock without much delay?