Spring Boot integration
Latest stable Based on Leader release 0.4.0
Auto-configure electors and guard invocations with AspectJ compile-time weaving.
Weaving model
Section titled “Weaving model”Release 0.4.0 uses Freefair post-compile AspectJ weaving. Do not add @EnableAspectJAutoProxy, and Kotlin methods do not need to be open. Private methods are not intercepted; startup validation reports invalid declarations. Verify the woven application artifact, not only a plain unit test.
Annotations
Section titled “Annotations”@LeaderElection supports nullable synchronous and suspend results plus Mono, Flux, and Flow. Long streams require autoExtend=true, or streamBounded=true only when completion is guaranteed inside the lease. @LeaderGroupElection supports synchronous, suspend, and Mono, but rejects Flux and Flow because per-slot stream extension is undefined.
Configuration safety
Section titled “Configuration safety”Use valid SpEL such as "'prefix-' + #param". Invalid expressions and impossible group settings fail validation. Auto-configuration orders elector creation, AOP factories, Micrometer, then aspects so instrumentation sees the same execution boundary.
Release sources
Section titled “Release sources”leader-spring-boot/README.mdleader-core/src/main/kotlin/io/bluetape4k/leader/annotation/LeaderElection.ktleader-core/src/main/kotlin/io/bluetape4k/leader/annotation/LeaderGroupElection.kt