<?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
">
    <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"/>
    <bean id="myLoadBalancer" class="org.redisson.connection.balancer.RoundRobinLoadBalancer"/>
    
    <redisson:client
        id="redisson"
        name="redisson1,redisson2"
        threads="0"
        netty-threads="0"
        codec-ref="myCodec" 
        use-linux-native-epoll="false"
        redisson-reference-enabled="true"
        codec-provider-ref="myCodecProvider"
        resolver-provider-ref="myResolverProvider"
        executor-ref="myExecutor"
        event-loop-group-ref="myEventLoopGroup"
    >
        <!--
        You can't have both name attribute and qualifier element at
        the same time. 

        Both id attribute and name attribute can be used as qualifier
        candidates.
        -->
        <!--<qualifier value="redisson3"/>-->
        <redisson:sentinel-servers
            idle-connection-timeout="10000"
            ping-timeout="1000"
            connect-timeout="10000"
            timeout="3000"
            retry-attempts="3"
            retry-interval="1500"
            reconnection-timeout="3000"
            failed-attempts="3"
            password="do_not_use_if_it_is_not_set"
            subscriptions-per-connection="5"
            client-name="none"
            ssl-enable-endpoint-identification="true"
            ssl-provider="JDK"
            ssl-truststore="/tmp/truststore.p12"
            ssl-truststore-password="no_pass"
            ssl-keystore="/tmp/keystore.p12"
            ssl-keystore-password="no_pass"
            load-balancer-ref="myLoadBalancer"
            subscription-connection-minimum-idle-size="1"
            subscription-connection-pool-size="50"
            slave-connection-minimum-idle-size="10"
            slave-connection-pool-size="64"
            master-connection-minimum-idle-size="10"
            master-connection-pool-size="64"
            read-mode="SLAVE"
            subscription-mode="SLAVE"
            master-name="myMaster"
            database="0"
        >
            <redisson:sentinel-address value="redis://127.0.0.1:26379" />
            <redisson:sentinel-address value="redis://127.0.0.1:26380" />
        </redisson:sentinel-servers>
    </redisson:client>
</beans>
