Skip to content
Leader docs0.4

Spring Boot or Ktor

Latest stable Based on Leader release 0.4.0

Choose integration from the host framework’s lifecycle and invocation model, not feature count.

Framework and observability ownership flow

Use the Spring module when electors should be auto-configured and methods guarded declaratively with @LeaderElection or @LeaderGroupElection. Release 0.4.0 uses AspectJ compile-time weaving, not proxy-only interception. It supports synchronous, suspend, Mono, Flux, and Flow shapes with stream-specific lease rules.

Use the Ktor plugin when the service already owns coroutine scheduling and wants an application-scoped SuspendLeaderElector. leaderScheduled() binds the periodic job to Ktor lifecycle and cancels it on ApplicationStopped.

Neither integration turns leader election into a scheduler or durable queue. Spring’s annotation wraps an invocation; Ktor’s helper launches a periodic coroutine. Misfire recovery, durable work state, retries, and idempotency still belong to the application or a job framework.