Untitled

mail@pastecode.io avatar
unknown
plain_text
15 days ago
695 B
3
Indexable
Never
    @Bean
    public RedissonConnectionFactory redissonConnectionFactory() throws IOException {
        return new RedissonConnectionFactory(redissonClient());
    }

    @Bean(destroyMethod = "shutdown")
    public RedissonClient redissonClient() throws IOException {
        Config config = new Config();
        config.useSingleServer()
                .setSslEnableEndpointIdentification(false)
                .setPassword(StringUtils.hasText(password) ? password : null)
                .setAddress(master);
        config.setCodec(new CompositeCodec(StringCodec.INSTANCE, new FstCodec(),
                StringCodec.INSTANCE));
        return Redisson.create(config);
    }
Leave a Comment