| package com.ruoyi.web.core.config; | 
|   | 
| import org.springframework.context.annotation.Bean; | 
| import org.springframework.context.annotation.Configuration; | 
| import org.springframework.data.redis.connection.RedisConnectionFactory; | 
| import org.springframework.data.redis.listener.RedisMessageListenerContainer; | 
|   | 
| @Configuration | 
| public class RedisConfiguration { | 
|   | 
|     //    创建一个新的Redis消息监听容器 | 
|     @Bean | 
|     RedisMessageListenerContainer redisContainer(RedisConnectionFactory connectionFactory) { | 
|         RedisMessageListenerContainer container = new RedisMessageListenerContainer(); | 
|         container.setConnectionFactory(connectionFactory); | 
|         return container; | 
|     } | 
|   | 
|   | 
| } |