Redisson

Database

[Redis] Redisson 분산락(DistributedLock) AOP 적용

이전 글 2023.11.07 - [Database] - [Redis] Redisson 분산 락을 간단하게 적용해 보기 분산 락 AOP 이용하기 build.gradle 아래 implementation을 추가한다. dependencies { //... implementation 'org.springframework.boot:spring-boot-starter-aop' implementation 'org.redisson:redisson-spring-boot-starter:3.17.0' } @DistributedLock @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface DistributedLock { /** * 락의..

Database

[Redis] Redisson 분산 락을 간단하게 적용해보기

문제 상황 어떤 데이터에 대해 매우 빠르게 수정이 일어날 때 동시성 문제가 발생할 수 있다. 예를 들어 A라는 데이터를 수정하는 로직이 0.1초 소요되는데, 0.001초 간격으로 A라는 데이터를 수정하는 요청이 여러 번 들어왔을 때 값이 제대로 수정되지 않을 수 있다. 이럴 때, DB 데이터 수정의 순차적 처리를 보장하기 위한 방법으로 Lock이 있다. Lock 트랜잭션 락과 비슷한 개념으로 어떤 데이터 수정, 접근 등에 Lock을 필요로 하게 설정하는 것이다. 데이터를 수정하려면 우선 Lock을 획득하고 수정 후에 Lock을 반납한다. 만약 Lock을 획득할 수 없는 상황에서는 Lock을 획득할 수 있을 때까지 대기하거나 수정을 취소할 수 있다. 분산 락(Distributed Lock) 하나의 공유 자..

Trouble Shooting

[오류 해결] Spring boot - Swagger, Redisson 적용 시 버전 conflict 문제 "Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException"

오류 발생 Redisson을 처음으로 사용해 보려고 설정을 완료하고 일단 한번 빌드하고 실행해 봤는데, org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException 이런 예외가 터지면서 실행이 중단되었다. swagger build.gradle 일단 이 문제가 발생한 프로젝트의 swagger implementation문이다. //swagger implementation 'io.springfox:springfox-boot-starter:3.0.0' implementation '..

HSRyuuu
'Redisson' 태그의 글 목록