Spring Boot 연동
최신 안정판 Leader 0.4.0 릴리스 기준
elector를 자동 구성하고 AspectJ compile-time weaving으로 메서드 호출을 보호합니다.
Weaving 방식
섹션 제목: “Weaving 방식”0.4.0은 Freefair post-compile AspectJ weaving을 사용합니다. @EnableAspectJAutoProxy를 추가하지 않으며 Kotlin 메서드를 open으로 만들 필요도 없습니다. private 메서드는 가로채지 못하므로 startup validation이 잘못된 선언을 알려 줍니다. 단순 unit test만 보지 말고 weaving된 애플리케이션 artifact를 검증합니다.
Annotation 규칙
섹션 제목: “Annotation 규칙”@LeaderElection은 nullable 동기·suspend 결과와 Mono, Flux, Flow를 지원합니다. 오래 실행되는 stream에는 autoExtend=true가 필요합니다. 리스 안에 끝난다고 보장할 수 있을 때만 streamBounded=true를 사용합니다. @LeaderGroupElection은 동기, suspend, Mono를 지원하지만 slot별 stream 연장 의미가 없어 Flux와 Flow는 거부합니다.
설정 안전성
섹션 제목: “설정 안전성”SpEL은 "'prefix-' + #param"처럼 유효한 식으로 작성합니다. 잘못된 식과 성립하지 않는 group 설정은 validation에서 실패합니다. 자동 구성은 elector, AOP factory, Micrometer, aspect 순으로 적용되어 계측과 실행 경계가 일치합니다.
릴리스 소스
섹션 제목: “릴리스 소스”leader-spring-boot/README.ko.mdleader-core/src/main/kotlin/io/bluetape4k/leader/annotation/LeaderElection.ktleader-core/src/main/kotlin/io/bluetape4k/leader/annotation/LeaderGroupElection.kt