org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration.LettuceClientConfigurationBuilder Java Examples
The following examples show how to use
org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration.LettuceClientConfigurationBuilder.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LettuceConnFactoryProvider.java From sofa-dashboard-client with Apache License 2.0 | 5 votes |
private LettuceClientConfiguration getLettuceClientConfiguration(ClientResources clientResources, Pool pool) { LettuceClientConfigurationBuilder builder = createBuilder(pool); applyProperties(builder); if (StringUtils.hasText(this.properties.getUrl())) { customizeConfigurationFromUrl(builder); } builder.clientResources(clientResources); return builder.build(); }
Example #2
Source File: LettuceConnFactoryProvider.java From sofa-dashboard-client with Apache License 2.0 | 5 votes |
private void applyProperties(LettuceClientConfigurationBuilder builder) { if (this.properties.isSsl()) { builder.useSsl(); } if (this.properties.getTimeout() != null) { builder.commandTimeout(this.properties.getTimeout()); } if (this.properties.getLettuce() != null) { SofaDashboardRedisProperties.Lettuce lettuce = this.properties.getLettuce(); if (lettuce.getShutdownTimeout() != null && !lettuce.getShutdownTimeout().isZero()) { builder.shutdownTimeout(this.properties.getLettuce().getShutdownTimeout()); } } }
Example #3
Source File: RedisConfiguration.java From dhis2-core with BSD 3-Clause "New" or "Revised" License | 5 votes |
@Bean public LettuceConnectionFactory lettuceConnectionFactory() { LettuceClientConfigurationBuilder builder = LettuceClientConfiguration.builder(); if(Boolean.parseBoolean( (String) redisSslEnabled().getObject())) { builder.useSsl(); } LettuceClientConfiguration clientConfiguration = builder.build(); RedisStandaloneConfiguration standaloneConfig = new RedisStandaloneConfiguration(); standaloneConfig.setHostName( (String) redisHost().getObject() ); standaloneConfig.setPassword( (String) redisPassword().getObject() ); standaloneConfig.setPort( Integer.parseInt( (String) redisPort().getObject() ) ); return new LettuceConnectionFactory( standaloneConfig, clientConfiguration ); }
Example #4
Source File: RedisLettuceClientConfigurer.java From spring-cloud-connectors with Apache License 2.0 | 5 votes |
@Override public LettuceClientConfigurationBuilder configure(LettuceClientConfigurationBuilder clientConfiguration, RedisConnectionFactoryConfig config) { if (config != null) { configurePool(clientConfiguration, config); configureClient(clientConfiguration, config); } return clientConfiguration; }
Example #5
Source File: RedisLettuceClientConfigurer.java From spring-cloud-connectors with Apache License 2.0 | 5 votes |
private void configurePool(LettuceClientConfigurationBuilder clientConfiguration, PooledServiceConnectorConfig config) { if (config.getPoolConfig() != null) { GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig(); BeanWrapper target = new BeanWrapperImpl(poolConfig); BeanWrapper source = new BeanWrapperImpl(config.getPoolConfig()); Util.setCorrespondingProperties(target, source); ((LettucePoolingClientConfigurationBuilder) clientConfiguration).poolConfig(poolConfig); } }
Example #6
Source File: LettuceConnFactoryProvider.java From sofa-dashboard-client with Apache License 2.0 | 4 votes |
private LettuceClientConfigurationBuilder createBuilder(Pool pool) { if (pool == null) { return LettuceClientConfiguration.builder(); } return new PoolBuilderFactory().createBuilder(pool); }
Example #7
Source File: LettuceConnFactoryProvider.java From sofa-dashboard-client with Apache License 2.0 | 4 votes |
private void customizeConfigurationFromUrl(LettuceClientConfigurationBuilder builder) { ConnectionInfo connectionInfo = parseUrl(this.properties.getUrl()); if (connectionInfo.isUseSsl()) { builder.useSsl(); } }
Example #8
Source File: LettuceConnFactoryProvider.java From sofa-dashboard-client with Apache License 2.0 | 4 votes |
LettuceClientConfigurationBuilder createBuilder(Pool properties) { return LettucePoolingClientConfiguration.builder() .poolConfig(getPoolConfig(properties)); }
Example #9
Source File: RedisLettuceClientConfigurer.java From spring-cloud-connectors with Apache License 2.0 | 4 votes |
public LettuceClientConfigurationBuilder configure(LettuceClientConfigurationBuilder clientConfiguration, PooledServiceConnectorConfig config) { if (config != null) { configurePool(clientConfiguration, config); } return clientConfiguration; }
Example #10
Source File: RedisLettuceClientConfigurer.java From spring-cloud-connectors with Apache License 2.0 | 4 votes |
private void configureClient(LettuceClientConfigurationBuilder clientConfiguration, RedisConnectionFactoryConfig config) { if (config.getConnectionProperties() != null) { mapClientConfigurer.configure(clientConfiguration, config.getConnectionProperties()); } }