Java Code Examples for org.redisson.config.Config#setEventLoopGroup()
The following examples show how to use
org.redisson.config.Config#setEventLoopGroup() .
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: RedissonAutoConfig.java From kk-anti-reptile with Apache License 2.0 | 7 votes |
@Bean(destroyMethod = "shutdown") @ConditionalOnMissingBean RedissonClient redisson() throws Exception { Config config = new Config(); config.useSingleServer().setAddress(address) .setConnectionMinimumIdleSize(connectionMinimumIdleSize) .setConnectionPoolSize(connectionPoolSize) .setDatabase(database) .setDnsMonitoringInterval(dnsMonitoringInterval) .setSubscriptionConnectionMinimumIdleSize(subscriptionConnectionMinimumIdleSize) .setSubscriptionConnectionPoolSize(subscriptionConnectionPoolSize) .setSubscriptionsPerConnection(subscriptionsPerConnection) .setClientName(clientName) .setRetryAttempts(retryAttempts) .setRetryInterval(retryInterval) .setTimeout(timeout) .setConnectTimeout(connectTimeout) .setIdleConnectionTimeout(idleConnectionTimeout) .setPassword(password); Codec codec=(Codec) ClassUtils.forName(getCodec(), ClassUtils.getDefaultClassLoader()).newInstance(); config.setCodec(codec); config.setEventLoopGroup(new NioEventLoopGroup()); return Redisson.create(config); }
Example 2
Source File: KlockAutoConfiguration.java From spring-boot-klock-starter with Apache License 2.0 | 6 votes |
@Bean(destroyMethod = "shutdown") @ConditionalOnMissingBean RedissonClient redisson() throws Exception { Config config = new Config(); if(klockConfig.getClusterServer()!=null){ config.useClusterServers().setPassword(klockConfig.getPassword()) .addNodeAddress(klockConfig.getClusterServer().getNodeAddresses()); }else { config.useSingleServer().setAddress(klockConfig.getAddress()) .setDatabase(klockConfig.getDatabase()) .setPassword(klockConfig.getPassword()); } Codec codec=(Codec) ClassUtils.forName(klockConfig.getCodec(),ClassUtils.getDefaultClassLoader()).newInstance(); config.setCodec(codec); config.setEventLoopGroup(new NioEventLoopGroup()); return Redisson.create(config); }
Example 3
Source File: RedissonConfig.java From kkFileViewOfficeEdit with Apache License 2.0 | 5 votes |
@Bean(destroyMethod = "shutdown") RedissonClient redisson() throws Exception { Config config = new Config(); config.useSingleServer().setAddress(address) .setConnectionMinimumIdleSize(connectionMinimumIdleSize) .setConnectionPoolSize(connectionPoolSize) .setDatabase(database) .setDnsMonitoring(dnsMonitoring) .setDnsMonitoringInterval(dnsMonitoringInterval) .setSubscriptionConnectionMinimumIdleSize(subscriptionConnectionMinimumIdleSize) .setSubscriptionConnectionPoolSize(subscriptionConnectionPoolSize) .setSubscriptionsPerConnection(subscriptionsPerConnection) .setClientName(clientName) .setFailedAttempts(failedAttempts) .setRetryAttempts(retryAttempts) .setRetryInterval(retryInterval) .setReconnectionTimeout(reconnectionTimeout) .setTimeout(timeout) .setConnectTimeout(connectTimeout) .setIdleConnectionTimeout(idleConnectionTimeout) .setPingTimeout(pingTimeout) .setPassword(password); Codec codec=(Codec) ClassUtils.forName(getCodec(), ClassUtils.getDefaultClassLoader()).newInstance(); config.setCodec(codec); config.setThreads(thread); config.setEventLoopGroup(new NioEventLoopGroup()); config.setUseLinuxNativeEpoll(false); return Redisson.create(config); }
Example 4
Source File: RedissonConfig.java From kkbinlog with Apache License 2.0 | 5 votes |
@Bean(destroyMethod = "shutdown") RedissonClient redisson() throws Exception { Config config = new Config(); config.setKeepPubSubOrder(keepPubSubOrder).useSingleServer().setAddress(address) .setConnectionMinimumIdleSize(connectionMinimumIdleSize) .setConnectionPoolSize(connectionPoolSize) .setDatabase(database) .setDnsMonitoring(dnsMonitoring) .setDnsMonitoringInterval(dnsMonitoringInterval) .setSubscriptionConnectionMinimumIdleSize(subscriptionConnectionMinimumIdleSize) .setSubscriptionConnectionPoolSize(subscriptionConnectionPoolSize) .setSubscriptionsPerConnection(subscriptionsPerConnection) .setClientName(clientName) .setFailedAttempts(failedAttempts) .setRetryAttempts(retryAttempts) .setRetryInterval(retryInterval) .setReconnectionTimeout(reconnectionTimeout) .setTimeout(timeout) .setConnectTimeout(connectTimeout) .setIdleConnectionTimeout(idleConnectionTimeout) .setPingTimeout(pingTimeout) .setPassword(password); Codec codec = (Codec) ClassUtils.forName(getCodec(), ClassUtils.getDefaultClassLoader()).newInstance(); config.setCodec(codec); config.setThreads(thread); config.setEventLoopGroup(new NioEventLoopGroup()); config.setUseLinuxNativeEpoll(false); return Redisson.create(config); }
Example 5
Source File: RedissonConfig.java From kkbinlog with Apache License 2.0 | 5 votes |
@Bean(destroyMethod = "shutdown") RedissonClient redisson() throws Exception { Config config = new Config(); config.setKeepPubSubOrder(keepPubSubOrder).useSingleServer().setAddress(address) .setConnectionMinimumIdleSize(connectionMinimumIdleSize) .setConnectionPoolSize(connectionPoolSize) .setDatabase(database) .setDnsMonitoring(dnsMonitoring) .setDnsMonitoringInterval(dnsMonitoringInterval) .setSubscriptionConnectionMinimumIdleSize(subscriptionConnectionMinimumIdleSize) .setSubscriptionConnectionPoolSize(subscriptionConnectionPoolSize) .setSubscriptionsPerConnection(subscriptionsPerConnection) .setClientName(clientName) .setFailedAttempts(failedAttempts) .setRetryAttempts(retryAttempts) .setRetryInterval(retryInterval) .setReconnectionTimeout(reconnectionTimeout) .setTimeout(timeout) .setConnectTimeout(connectTimeout) .setIdleConnectionTimeout(idleConnectionTimeout) .setPingTimeout(pingTimeout) .setPassword(password); Codec codec = (Codec) ClassUtils.forName(getCodec(), ClassUtils.getDefaultClassLoader()).newInstance(); config.setCodec(codec); config.setThreads(thread); config.setEventLoopGroup(new NioEventLoopGroup()); config.setUseLinuxNativeEpoll(false); return Redisson.create(config); }
Example 6
Source File: RedissonConfig.java From kkbinlog with Apache License 2.0 | 5 votes |
@Bean(destroyMethod = "shutdown") RedissonClient redisson() throws Exception { Config config = new Config(); config.setKeepPubSubOrder(keepPubSubOrder).useSingleServer().setAddress(address) .setConnectionMinimumIdleSize(connectionMinimumIdleSize) .setConnectionPoolSize(connectionPoolSize) .setDatabase(database) .setDnsMonitoring(dnsMonitoring) .setDnsMonitoringInterval(dnsMonitoringInterval) .setSubscriptionConnectionMinimumIdleSize(subscriptionConnectionMinimumIdleSize) .setSubscriptionConnectionPoolSize(subscriptionConnectionPoolSize) .setSubscriptionsPerConnection(subscriptionsPerConnection) .setClientName(clientName) .setFailedAttempts(failedAttempts) .setRetryAttempts(retryAttempts) .setRetryInterval(retryInterval) .setReconnectionTimeout(reconnectionTimeout) .setTimeout(timeout) .setConnectTimeout(connectTimeout) .setIdleConnectionTimeout(idleConnectionTimeout) .setPingTimeout(pingTimeout) .setPassword(password); Codec codec = (Codec) ClassUtils.forName(getCodec(), ClassUtils.getDefaultClassLoader()).newInstance(); config.setCodec(codec); config.setThreads(thread); config.setEventLoopGroup(new NioEventLoopGroup()); config.setUseLinuxNativeEpoll(false); return Redisson.create(config); }
Example 7
Source File: RedissonConfig.java From kkbinlog with Apache License 2.0 | 5 votes |
@Bean(destroyMethod = "shutdown") RedissonClient redisson() throws Exception { Config config = new Config(); config.setKeepPubSubOrder(keepPubSubOrder).useSingleServer().setAddress(address) .setConnectionMinimumIdleSize(connectionMinimumIdleSize) .setConnectionPoolSize(connectionPoolSize) .setDatabase(database) .setDnsMonitoring(dnsMonitoring) .setDnsMonitoringInterval(dnsMonitoringInterval) .setSubscriptionConnectionMinimumIdleSize(subscriptionConnectionMinimumIdleSize) .setSubscriptionConnectionPoolSize(subscriptionConnectionPoolSize) .setSubscriptionsPerConnection(subscriptionsPerConnection) .setClientName(clientName) .setFailedAttempts(failedAttempts) .setRetryAttempts(retryAttempts) .setRetryInterval(retryInterval) .setReconnectionTimeout(reconnectionTimeout) .setTimeout(timeout) .setConnectTimeout(connectTimeout) .setIdleConnectionTimeout(idleConnectionTimeout) .setPingTimeout(pingTimeout) .setPassword(password); Codec codec = (Codec) ClassUtils.forName(getCodec(), ClassUtils.getDefaultClassLoader()).newInstance(); config.setCodec(codec); config.setThreads(thread); config.setEventLoopGroup(new NioEventLoopGroup()); config.setUseLinuxNativeEpoll(false); return Redisson.create(config); }
Example 8
Source File: RedissonMultiLockTest.java From redisson with Apache License 2.0 | 5 votes |
private RedissonClient createClient(NioEventLoopGroup group, String host) { Config config1 = new Config(); config1.useSingleServer().setAddress(host); config1.setEventLoopGroup(group); RedissonClient client1 = Redisson.create(config1); client1.getKeys().flushdb(); return client1; }
Example 9
Source File: RedissonRedLockTest.java From redisson with Apache License 2.0 | 5 votes |
private RedissonClient createClient(NioEventLoopGroup group, String host) { Config config1 = new Config(); config1.useSingleServer().setAddress(host); config1.setEventLoopGroup(group); RedissonClient client1 = Redisson.create(config1); client1.getKeys().flushdb(); return client1; }