Bungeecord Locking (BUNGEECORD)
This document describes the optional BUNGEECORD locking strategy which provides cross-server distributed locks mediated by a lightweight proxy running on your Bungee/Waterfall proxy.
Overview
BUNGEECORDuses a small proxy plugin on the Bungee instance to act as the authoritative lock manager.- Servers run the
ezeconomy-bungeecordextension (placed inplugins/EzEconomy/libs/) which communicates with the proxy via the plugin messaging channel. - This is an alternative to
REDISwhen you prefer not to run Redis but still want cross-server synchronization.
Components
ezeconomy-bungeecord(server-side extension): implementscom.skyblockexp.ezeconomy.lock.LockManagerand communicates with the proxy.ezeconomy-bungeecord-proxy(proxy plugin): runs on the Bungee/Waterfall proxy and mediates lock acquire/release requests.
Quick setup
- Deploy
ezeconomy-bungeecord.jarintoplugins/EzEconomy/libs/on each backend server. - Deploy
ezeconomy-bungeecord-proxy.jarto your Bungee/Waterfall proxyplugins/folder. -
In the core
config.ymlset:locking-strategy: BUNGEECORD - Optionally edit
bungeecord.ymlin the EzEconomy data folder to tunechannel,ttl-ms,retry-ms, andfallback-to-local(see config keys below). - Restart the proxy and backend servers.
bungeecord.yml configuration keys:
shared-secret: optional string to authenticate messages between servers and the proxy. Set identical value on proxy and servers.cleanup-interval-ms: interval in milliseconds for the proxy to run TTL cleanup on expired locks (default 5000).channel: plugin messaging channel (defaultezeconomy:locks).ttl-ms: default TTL for acquired locks (server-side setting used when sending requests).
Security
- The plugin messaging channel is only accessible to servers connected to your proxy. For extra safety, configure the optional
shared-secretinbungeecord.ymland on the proxy.
Proxy configuration
- Place a
bungeecord.ymlnext to the proxy’s plugin data folder and include the following keys (example):
shared-secret: "your-secret"
cleanup-interval-ms: 5000
channel: ezeconomy:locks
- The proxy will validate incoming requests’
shared-secret(if configured) and include the secret inACQUIRE_RESPONSEpayloads. The proxy periodically evicts expired locks usingcleanup-interval-ms.
Deployment notes
- The server-side transport uses the Bukkit plugin messaging channel and requires at least one online player to send messages to the proxy. In production, ensure that at least one player or a lightweight connection helper is present on each backend server.
- For high-availability or multi-proxy setups, coordinate lock ownership carefully — the simple proxy is single-authority and not clustered. Consider
REDISstrategy for clustered environments.
Notes
- The current implementation in this repository provides a testable transport and an in-memory mock proxy; the production-ready transport uses plugin messaging and must be enabled/packaged in
ezeconomy-bungeecord. - If the proxy is unavailable and
fallback-to-localis enabled, EzEconomy will fall back to local locking.
See also