Skip to content

Commit

Permalink
Merge branch 'be/challenge/redis-study' of https://github.com/innovat…
Browse files Browse the repository at this point in the history
…ionacademy-kr/42cabi into be/challenge/redis-study
  • Loading branch information
LeeDaeWook committed Aug 17, 2023
2 parents cfe9aa8 + 5dc9db2 commit b0ee73c
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,35 @@

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.ftclub.cabinet.redis.ExpirationListener;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.RedisKeyValueAdapter;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.listener.PatternTopic;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;
import org.springframework.data.redis.serializer.StringRedisSerializer;

@Getter
@Configuration
@RequiredArgsConstructor
@EnableRedisRepositories()
@EnableRedisRepositories // Redis Repository 활성화
public class RedisRepositoryConfig {

@Value("${spring.redis.host}")
private String host;
@Value("${spring.redis.port}")
private int port;

@Bean
public RedisMessageListenerContainer redisMessageListenerContainer(RedisConnectionFactory redisConnectionFactory) {
public RedisMessageListenerContainer redisMessageListenerContainer(
RedisConnectionFactory redisConnectionFactory) {
RedisMessageListenerContainer redisMessageListenerContainer = new RedisMessageListenerContainer();
redisMessageListenerContainer.setConnectionFactory(redisConnectionFactory);
return redisMessageListenerContainer;
}

@Value("${spring.redis.host}")
private String host;

@Value("${spring.redis.port}")
private int port;

/**
* 내장 혹은 외부의 Redis를 연결
*/
Expand Down

0 comments on commit b0ee73c

Please sign in to comment.