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

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

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

Config.useSingleServer介绍

[英]Init single server configuration.
[中]初始化单服务器配置。

代码示例

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

/**
 * Init single server configuration.
 *
 * @return SingleServerConfig
 */
public SingleServerConfig useSingleServer() {
  return useSingleServer(new SingleServerConfig());
}

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

/**
 * Init single server configuration.
 *
 * @return SingleServerConfig
 */
public SingleServerConfig useSingleServer() {
  return useSingleServer(new SingleServerConfig());
}

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

/**
 * Init single server configuration.
 *
 *  config.useSingleServer().setAddress("redis://myredisserver:6379");
 *
 * @return SingleServerConfig
 */
public SingleServerConfig redisSingleServer() {
  enableDistributedQueue();
  return redissonConfig.useSingleServer();
}

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

/**
 * Create Reactive Redisson instance with default config
 *
 * @return Redisson instance
 */
public static RedissonReactiveClient createReactive() {
  Config config = new Config();
  config.useSingleServer().setAddress("redis://127.0.0.1:6379");
  return createReactive(config);
}

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

/**
 * Create Reactive Redisson instance with default config
 *
 * @return Redisson instance
 */
public static RedissonRxClient createRx() {
  Config config = new Config();
  config.useSingleServer().setAddress("redis://127.0.0.1:6379");
  return createRx(config);
}

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

/**
 * Create Reactive Redisson instance with default config
 *
 * @return Redisson instance
 */
public static RedissonReactiveClient createReactive() {
  Config config = new Config();
  config.useSingleServer().setAddress("redis://127.0.0.1:6379");
  return createReactive(config);
}

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

/**
 * Create Reactive Redisson instance with default config
 *
 * @return Redisson instance
 */
public static RedissonRxClient createRx() {
  Config config = new Config();
  config.useSingleServer().setAddress("redis://127.0.0.1:6379");
  return createRx(config);
}

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

/**
   * Create sync/async Redisson instance with default config
   *
   * @return Redisson instance
   */
  public static RedissonClient create() {
    Config config = new Config();
    config.useSingleServer()
    .setTimeout(1000000)
    .setAddress("redis://127.0.0.1:6379");
//        config.useMasterSlaveConnection().setMasterAddress("127.0.0.1:6379").addSlaveAddress("127.0.0.1:6389").addSlaveAddress("127.0.0.1:6399");
//        config.useSentinelConnection().setMasterName("mymaster").addSentinelAddress("127.0.0.1:26389", "127.0.0.1:26379");
//        config.useClusterServers().addNodeAddress("127.0.0.1:7000");
    return create(config);
  }

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

/**
   * Create sync/async Redisson instance with default config
   *
   * @return Redisson instance
   */
  public static RedissonClient create() {
    Config config = new Config();
    config.useSingleServer()
    .setTimeout(1000000)
    .setAddress("redis://127.0.0.1:6379");
//        config.useMasterSlaveConnection().setMasterAddress("127.0.0.1:6379").addSlaveAddress("127.0.0.1:6389").addSlaveAddress("127.0.0.1:6399");
//        config.useSentinelConnection().setMasterName("mymaster").addSentinelAddress("127.0.0.1:26389", "127.0.0.1:26379");
//        config.useClusterServers().addNodeAddress("127.0.0.1:7000");
    return create(config);
  }

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

@Override
  public RedissonClient get() {
    // JDK serialization codec for now, but we can do better in speed and space
    final Codec codec = new SerializationCodec();

    final Config redissonCfg = new Config();
    redissonCfg.setCodec(codec)
          .useSingleServer()
          .setAddress(address)
          .setConnectionMinimumIdleSize(connectionMinimumIdleSize);
    return Redisson.create(redissonCfg);
  }
}

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

config.useSingleServer()
  .setAddress(prefix + redisProperties.getHost() + ":" + redisProperties.getPort())
  .setConnectTimeout(timeout)

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

/**
 * Init single server configuration.
 *
 * @return SingleServerConfig
 */
public SingleServerConfig useSingleServer() {
  return useSingleServer(new SingleServerConfig());
}

代码示例来源:origin: heibaiying/spring-samples-for-all

@Bean
public RedissonClient redissonClient() {
  Config config = new Config();
  config.setTransportMode(TransportMode.NIO);
  config.useSingleServer().setAddress("redis://127.0.0.1:6379");
  return Redisson.create(config);
}

代码示例来源:origin: TaXueWWL/redis-distributed-lock

public static void main(String[] args) {
    Config config = new Config();
    config.useSingleServer().setAddress("redis://127.0.0.1:6379");
    Redisson redisson = (Redisson) Redisson.create(config);
  }
}

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

/**
 * Create Reactive Redisson instance with default config
 *
 * @return Redisson instance
 */
public static RedissonRxClient createRx() {
  Config config = new Config();
  config.useSingleServer().setAddress("redis://127.0.0.1:6379");
  return createRx(config);
}

代码示例来源:origin: jiangmin168168/jim-framework

@PostConstruct
public void init() {
  Config config = new Config();
  config.useSingleServer()
      .setAddress(this.host + ":" + this.port)
      // .setPassword(this.pass)
  .setConnectionPoolSize(10)
  .setConnectTimeout(10000)
  ;
  redisson = Redisson.create(config);
}

代码示例来源:origin: techa03/goodsKill

@Override
public void afterPropertiesSet() {
  Config config = new Config();
  config.useSingleServer().setAddress(propertiesUtil.getProperty("cache_ip_address"));
  redissonClient = Redisson.create(config);
}

代码示例来源:origin: org.kill-bill.billing/killbill-util

@Override
  public RedissonClient get() {
    // JDK serialization codec for now, but we can do better in speed and space
    final Codec codec = new SerializationCodec();

    final Config redissonCfg = new Config();
    redissonCfg.setCodec(codec)
          .useSingleServer()
          .setAddress(address)
          .setConnectionMinimumIdleSize(connectionMinimumIdleSize);
    return Redisson.create(redissonCfg);
  }
}

代码示例来源:origin: xuminwlt/j360-dubbo-app-all

@Bean(name = "redissonClient", destroyMethod = "shutdown")
public RedissonClient redisson() {
  Config config = new Config();
  config.useSingleServer()
      .setAddress(redisAddress)
      .setDatabase(0)
      .setConnectionMinimumIdleSize(3)
      .setConnectionPoolSize(5)
      .setIdleConnectionTimeout(3000)
      .setConnectTimeout(3000)
      .setTimeout(3000);
  return Redisson.create(config);
}

代码示例来源:origin: xuminwlt/j360-dubbo-app-all

@Bean(name = "redissonClient", destroyMethod = "shutdown")
public RedissonClient redisson() {
  Config config = new Config();
  config.useSingleServer()
      .setAddress("redis://127.0.0.1:6379")
      .setDatabase(0)
      .setConnectionMinimumIdleSize(3)
      .setConnectionPoolSize(5)
      .setIdleConnectionTimeout(3000)
      .setConnectTimeout(3000)
      .setTimeout(3000);
  return Redisson.create(config);
}

相关文章