<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
       xmlns:redisson="http://redisson.org/schema/redisson"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
       http://redisson.org/schema/redisson classpath:org/redisson/spring/support/redisson-1.1.xsd
">
    <context:property-placeholder system-properties-mode="OVERRIDE"/>
    
    <bean id="myCodec" class="org.redisson.codec.MsgPackJacksonCodec"/>
    <bean id="myCodecProvider" class="org.redisson.codec.DefaultCodecProvider"/>
    <bean id="myResolverProvider" class="org.redisson.liveobject.provider.DefaultResolverProvider"/>
    <bean id="myExecutor" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="staticMethod" value="java.util.concurrent.Executors.newFixedThreadPool"/>
        <property name="arguments" value="8"/>
    </bean>
    <bean id="myEventLoopGroup" class="io.netty.channel.nio.NioEventLoopGroup"/>
    
    <redisson:client
        id="myId"
        name="name1,name2"
        threads="${redisson.threads}"
        netty-threads="${redisson.nettyThreads}"
        codec-ref="${redisson.codecRef}" 
        use-linux-native-epoll="${redisson.useLinuxNativeEpoll}"
        redisson-reference-enabled="${redisson.redissonReferenceEnabled}"
        codec-provider-ref="${redisson.codecProviderRef}"
        resolver-provider-ref="${redisson.resolverProviderRef}"
        executor-ref="${redisson.executorRef}"
        event-loop-group-ref="${redisson.eventLoopGroupRef}"
    >
        <redisson:single-server
            idle-connection-timeout="${redisson.idleConnectionTimeout}"
            connect-timeout="${redisson.connectTimeout}"
            timeout="${redisson.timeout}"
            retry-attempts="${redisson.retryAttempts}"
            retry-interval="${redisson.retryInterval}"
            reconnection-timeout="${redisson.reconnectionTimeout}"
            failed-attempts="${redisson.failedAttempts}"
            password="${redisson.password}"
            subscriptions-per-connection="${redisson.subscriptionsPerConnection}"
            client-name="${redisson.clientName}"         
            ssl-enable-endpoint-identification="${redisson.sslEnableEndpointIdentification}"
            ssl-provider="${redisson.sslProvider}"
            ssl-truststore="${redisson.sslTruststore}"
            ssl-truststore-password="${redisson.sslTruststorePassword}"
            ssl-keystore="${redisson.sslKeystore}"
            ssl-keystore-password="${redisson.sslKeystorePassword}"   
            address="${redisson.redisAddress}"
            subscription-connection-minimum-idle-size="${redisson.subscriptionConnectionMinimumIdleSize}"
            subscription-connection-pool-size="${redisson.subscriptionConnectionPoolSize}"
            connection-minimum-idle-size="${redisson.connectionMinimumIdleSize}"
            connection-pool-size="${redisson.connectionPoolSize}"
            database="${redisson.database}"
            dns-monitoring="${redisson.dnsMonitoring}"
            dns-monitoring-interval="${redisson.dnsMonitoringInterval}"
        />
    </redisson:client>
</beans>
