title: How to lock redis cluster for an application in java
body: <p>I've two java applications (app1, app2). Both applications are using <code>JedisCluster</code> client for Redis cluster. app1 write or read data from Redis cluster. app2 is like a scheduler which only writes some data to Redis cluster. it runs after a fixed time of interval. I've to ensure that when app2 is doing write operation, no data is served or written for app1 until the whole write operation is finished by app2. I want to lock Redis cluster for app1 when app2 is running. it doesn't matter whether app1 get an exception or not at that time.       </p>