org.redisson.config.Config.useReplicatedServers()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(595)

本文整理了Java中org.redisson.config.Config.useReplicatedServers()方法的一些代码示例,展示了Config.useReplicatedServers()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.useReplicatedServers()方法的具体详情如下:
包路径:org.redisson.config.Config
类名称:Config
方法名:useReplicatedServers

Config.useReplicatedServers介绍

[英]Init Replicated servers configuration. Most used with Azure Redis Cache or AWS Elasticache
[中]初始化复制服务器配置。最常用于Azure Redis缓存或AWS Elasticache

代码示例

代码示例来源:origin: redisson/redisson

/**
 * Init Replicated servers configuration.
 * Most used with Azure Redis Cache or AWS Elasticache
 *
 * @return ReplicatedServersConfig
 */
public ReplicatedServersConfig useReplicatedServers() {
  return useReplicatedServers(new ReplicatedServersConfig());
}

代码示例来源:origin: redisson/redisson

/**
 * Init Replicated servers configuration.
 * Most used with Azure Redis Cache or AWS Elasticache
 *
 * @return ReplicatedServersConfig
 */
public ReplicatedServersConfig useReplicatedServers() {
  return useReplicatedServers(new ReplicatedServersConfig());
}

代码示例来源:origin: zhegexiaohuozi/SeimiCrawler

/**
 * Init Replicated servers configuration.
 * Most used with Azure Redis Cache or AWS Elasticache
 *
 * config.useReplicatedServers()
 *     .setScanInterval(2000) // 主节点变化扫描间隔时间
 *     //可以用"rediss://"来启用SSL连接
 *     .addNodeAddress("redis://127.0.0.1:7000", "redis://127.0.0.1:7001")
 *     .addNodeAddress("redis://127.0.0.1:7002");
 *
 * @return ReplicatedServersConfig
 */
public ReplicatedServersConfig redisReplicatedServers() {
  enableDistributedQueue();
  return redissonConfig.useReplicatedServers();
}

代码示例来源:origin: org.redisson/redisson

/**
 * Init Replicated servers configuration.
 * Most used with Azure Redis Cache or AWS Elasticache
 *
 * @return ReplicatedServersConfig
 */
public ReplicatedServersConfig useReplicatedServers() {
  return useReplicatedServers(new ReplicatedServersConfig());
}

代码示例来源:origin: chexagon/redis-session-manager

ReplicatedServersConfig ecCfg = config.useReplicatedServers();
ecCfg
  .addNodeAddress(nodes.trim().split("\\s+"))

代码示例来源:origin: justlive1/earth-frost

/**
 * 云托管模式
 * 
 * @param redissonProperties
 * @return client
 */
private RedissonClient redissonReplicatedServers(RedissonProperties redissonProperties) {
 Config config = new Config();
 ReplicatedServersConfig serverConfig =
   config.useReplicatedServers().addNodeAddress(redissonProperties.getNodeAddresses())
     .setTimeout(redissonProperties.getTimeout())
     .setScanInterval(redissonProperties.getScanInterval())
     .setDnsMonitoringInterval(redissonProperties.getDnsMonitoringInterval())
     .setSlaveConnectionPoolSize(redissonProperties.getSlaveConnectionPoolSize())
     .setMasterConnectionPoolSize(redissonProperties.getMasterConnectionPoolSize());
 if (redissonProperties.getPassword() != null && redissonProperties.getPassword().length() > 0) {
  serverConfig.setPassword(redissonProperties.getPassword());
 }
 return Redisson.create(config);
}

相关文章