Locking Strategy
Quick summary
- Default:
LOCAL(in-JVM locking). No extra setup required. REDISis optional and recommended only for multi-server setups that need cross-instance synchronization.
Config keys
locking-strategy(in the mainconfig.yml)- Type:
string - Allowed values:
LOCAL,REDIS,BUNGEECORD - Default:
LOCAL
- Type:
lockingsection (inconfig.yml, added in v3.1.0):
locking:
ttl-ms: 10000 # Lock expiry time in milliseconds
retry-ms: 50 # Delay between lock acquisition retries
max-attempts: 20 # Maximum retry attempts before giving up
These timing values apply to all lock strategies and replace the previously hardcoded defaults.
When to use which
LOCAL: Single server or small networks where each server handles its own state. Easiest to run and troubleshoot.REDIS: Multiple servers sharing the same economy state. Requires theezeconomy-redisextension and a configuredredis.yml.BUNGEECORD: Proxy-backed locking via plugin messaging. Requiresezeconomy-bungeecord-proxyon the proxy. Single-authority model, not suitable for multi-proxy clusters.
Behavior & safety
- If
REDISis selected but Redis cannot be initialized,fallback-to-localinredis.ymlcontrols whether the plugin falls back to local locking or disables Redis locking on startup. - Transfer operations acquire locks in a deterministic UUID order to avoid cross-instance deadlocks.
- Changing this setting requires a plugin restart.
How to enable Redis
- Install the optional extension
ezeconomy-redis.jarintoplugins/EzEconomy/libs/. - Set
locking-strategy: REDISinconfig.yml. - Configure
redis.yml(seedocs/redis.md) and restart the server.
See also
- Redis integration —
redis.ymlsetup, installation, and troubleshooting. - Cross-server messaging — payment notification transports.
- Proxy network — BungeeCord proxy-backed locking and caching.