Last active
February 7, 2020 11:54
-
-
Save brachi-wernick/9073833ebe52997e831e122f914c94b1 to your computer and use it in GitHub Desktop.
RedisClientFactory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RedisClientFactory implements DefaultValueFactory<RedissonClient> { | |
@Override | |
public RedissonClient create(PipelineOptions options) { | |
RedisOptions redisOptions = options.as(RedisOptions.class); | |
Config config = new Config(); | |
config.useSingleServer() | |
.setAddress("redis://" + redisOptions.getRedisHost().get() + ":" + redisOptions.getRedisPort().get()"); | |
return Redisson.create(config); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment