Skip to content
Garvit Joshi edited this page Oct 9, 2026 · 12 revisions

Locksmith is a Spring Boot starter for Redis-based distributed locks and semaphores, built on Redisson. The README has the requirements, the installation and a quick start. This wiki covers the rest, one topic per page:

  • Locks: @DistributedLock, its attributes, the lock types and how a lock's lease is renewed or fixed.
  • Semaphores: @DistributedSemaphore, its attributes, permit leases and how the permit count is kept in Redis.
  • Key templates: how a key such as order:#{#orderId} is resolved to a Redis key.
  • Failure handling: throw, skip or call a handler when a lock or permit is not acquired.
  • With other Spring annotations: how Locksmith works with Spring Security, @Transactional, @Cacheable, @Async and retries, including methods that return a future.
  • Programmatic API: the LockOperations and SemaphoreOperations beans, for locking in code instead of with an annotation.
  • Configuration: the properties, your own RedissonClient bean, startup checks and what Locksmith logs.
  • Metrics: the two Micrometer timers Locksmith records.
  • Limitations: what Locksmith does not guarantee, and what to do about it.

Upgrading from 3.x: the migration table is in CHANGELOG.md.

Clone this wiki locally