/**
* redisson cache manager
*/
@Configuration
@ComponentScan
@EnableCaching
public class RedissonConfig {
@Bean(destroyMethod="shutdown")
public RedissonClient redisson(@Value("classpath:/redisson-server.json") Resource configFile) throws IOException {
Config config = Config.fromJSON(configFile.getInputStream());
return Redisson.create(config);
}
@Bean
public CacheManager cacheManager(RedissonClient redissonClient) throws IOException {
return new RedissonSpringCacheManager(redissonClient, "classpath:/redisson-cache.json");
}
}