spring
[Spring Boot] RedisCommandExecutionException: ERR unknown command 'CONFIG', with args beginning with: 'GET' 'notify-keyspace-events'
moonsiri
2023. 5. 19. 12:20
728x90
반응형
io.lettuce.core.RedisCommandExecutionException: ERR unknown command 'CONFIG', with args beginning with: 'GET' 'notify-keyspace-events'
...
org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR unknown command 'CONFIG', with args beginning with: 'GET' 'notify-keyspace-events'
...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource [org/springframework/boot/autoconfigure/session/RedisSessionConfiguration$SpringBootRedisHttpSessionConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR unknown command 'CONFIG', with args beginning with: 'GET' 'notify-keyspace-events'
...
@EnableRedisHttpSession을 사용하는 경우 AutoConfiguration으로 RedisIndexedSessionRepository를 생성하여 사용합니다.
RedisIndexedSessionRepository는 {redisNamespace}:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:collenkim:{username} 이라는 Set을 만드는 데, 해당 Set에서 member를 삭제하려면 SessionDestroyedEvent를 수신받아야합니다.
ConfigureRedisAction.NO_OP을 Bean으로 추가하면 Redis config의 notify-keyspace-events에 SessionDestroyedEvent를 설정하지 않습니다.
@Bean
public ConfigureRedisAction configureRedisAction() {
return ConfigureRedisAction.NO_OP;
}
notifiy-keyspace-events 활성화 방법은 아래 포스팅에서 확인해주세요.
728x90
반응형