redis.yml — Redis configuration (short guide)
Quick summary
- Redis is optional. The plugin defaults to local (in-JVM) locking for single-server setups.
- Use Redis for multi-server deployments that need cross-instance locking and/or cross-server messaging.
- The Redis implementation is shipped as an optional extension jar (
ezeconomy-redis.jar).
Enable Redis (high level)
- Install the optional extension: put
ezeconomy-redis.jarintoplugins/EzEconomy/libs/and restart your server. - In the main
config.ymlsetlocking-strategy: REDISand restart. - Configure
redis.yml(example below) and ensure the Redis server is reachable.
Minimal redis.yml example
enabled: true
host: 127.0.0.1
port: 6379
password: ""
database: 0
# Lock behaviour
ttl-ms: 10000
retry-ms: 50
max-attempts: 20
prefix: "ezeconomy:lock:"
# If Redis initialization fails, the plugin can fall back to local locking
fallback-to-local: true
Notes for server owners
- Default behavior: If you do nothing, the plugin uses
LocalLockManager(no Redis required). enabled: falseinredis.ymlforces local locking even iflocking-strategyis set toREDIS.fallback-to-local: truemeans a Redis connection error will not break the server — it will switch to local locking. Set tofalseonly if you want startup to fail on Redis errors.
Installation checklist
- Build or download
ezeconomy-redis.jar(this includes the Redis client and is optional). - Place it at
plugins/EzEconomy/libs/ezeconomy-redis.jar. - Edit
config.ymland setlocking-strategy: REDIS. - Edit
redis.ymlwith your Redis host/credentials. - Restart the server and check logs for a message like: “Using RedisLockManager” or “Falling back to LocalLockManager”.
Troubleshooting
- If the plugin falls back to local locking, check
redis.ymland server logs for connection errors. - Verify network/firewall rules allow the Minecraft server to reach the Redis host and port.
- For secured Redis, ensure
passwordis set and correct.
Security & production tips
- Prefer using a private Redis instance or VPC; avoid exposing Redis to the public internet.
- Monitor latency — Redis timeouts will affect lock acquisition and operation latency.
Testing
- The repository includes unit tests that mock Redis for local CI. For full integration, run the Testcontainers-based CI job or test against a local Redis instance.
Cross-Server Messaging via Redis
As of v3.1.0, the ezeconomy-redis extension also provides RedisMessagingTransport for proxy-independent cross-server payment notifications. This uses Redis pub/sub and does not require a Velocity or BungeeCord proxy.
Add to redis.yml:
messaging:
channel: ezeconomy:messages
Enable cross-server messaging in config.yml:
cross-server:
enabled: true
See Cross-server messaging for transport comparison and configuration details.
See also
- Locking strategy — how to choose LOCAL vs REDIS vs BUNGEECORD.
- Cross-server messaging — all messaging transport options.
- Source:
RedisLockManagerandRedisMessagingTransport(extension module).