-
2023.10.22 kafka transactionTIL 2023. 10. 21. 22:03
ALO 트랜잭션 아웃 박스
EO
AMO
ENABLE_IDEMPOTENCE_CONFIG
https://yangbongsoo.tistory.com/132
https://yangbongsoo.tistory.com/77
https://dhkdn9192.github.io/apache-kafka/kakfa-exactly-once-delivery/
카프카 트랜잭션을 하려면
producer는 transaction id 설정과 멱등성을 보장하는 idempotence을 설정해놓아야하고
consumer는 isolation.level을 read committed로 해놓아야한다.
개념적으로 보면 프로듀서가 transaction을 시작하고 커밋을 해야 컨슈머가 읽는다는 것이다.
기본적으로 consumer는 read uncommitted이다.
producer는 transaction을 사용한다고 선언했으면 spring transaction annotion안에서 메시지를 발행해야한다.
producer가 commit을 하지 않았다면 consumer는 메시지를 소비하지 못해서 lag이 증가한다
'TIL' 카테고리의 다른 글
2023.10.28 spring security ip (0) 2023.10.28 2023.10.25 multi tenancy pk (0) 2023.10.25 2023.10.15 기록장 (0) 2023.10.15 2023.09.27 기록장 (0) 2023.09.27 2023.09.23 기록장 (0) 2023.09.22