UPDATE 02-sept
This commit is contained in:
@@ -15,13 +15,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.ReactiveRedisTemplate;
|
||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
|
||||
import org.springframework.data.redis.listener.PatternTopic;
|
||||
import org.springframework.data.redis.serializer.RedisSerializationContext;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
import com.example.service.notification.NotificationExpirationListener;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* Spring configuration class for setting up Reactive Redis(Memorystore in GCP)
|
||||
@@ -79,14 +74,4 @@ public ReactiveRedisTemplate<String, NotificationSessionDTO> reactiveNotificatio
|
||||
.build();
|
||||
return new ReactiveRedisTemplate<>(factory, context);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisMessageListenerContainer keyExpirationListenerContainer(
|
||||
@Autowired RedisConnectionFactory connectionFactory,
|
||||
@Autowired NotificationExpirationListener notificationExpirationListener) {
|
||||
RedisMessageListenerContainer listenerContainer = new RedisMessageListenerContainer();
|
||||
listenerContainer.setConnectionFactory(connectionFactory);
|
||||
listenerContainer.addMessageListener(notificationExpirationListener, new PatternTopic("__keyevent@*__:expired"));
|
||||
return listenerContainer;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user