Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Bean(destroyMethod = "shutdown")
- RedissonClient redisson() throws Exception {
- URI uri = URI.create(redisUrl);
- Config config = new Config();
- final SingleServerConfig singleServerConfig = config.useSingleServer();
- singleServerConfig.setAddress(new URI(uri.getScheme(), null, uri.getHost(), uri.getPort(), null, null, null).toString());
- if (StringUtils.hasText(uri.getUserInfo())) {
- String password = uri.getUserInfo().split(":", 2)[1];
- singleServerConfig.setPassword(password);
- }
- return Redisson.create(config);
- }
Add Comment
Please, Sign In to add comment