<?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:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd">
    <description>Tigon Redis</description>

    <!-- Redis Config -->
    <bean id="redisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
        p:host-name="${redis.host:localhost}"
        p:port="${redis.port:6379}"
        p:password="${redis.password:}" 
        p:database="${redis.database:0}" /> 
    <!-- String tpl -->
    <bean class="org.springframework.data.redis.core.StringRedisTemplate"> 
        <constructor-arg ref="redisConnectionFactory" />
    </bean>
    <!-- Object tpl -->
    <bean class="org.springframework.data.redis.core.RedisTemplate">
        <property name="connectionFactory" ref="redisConnectionFactory" />
        <property name="keySerializer">
            <bean class="org.springframework.data.redis.serializer.StringRedisSerializer" />
        </property>
        <property name="hashKeySerializer">
            <bean class="org.springframework.data.redis.serializer.StringRedisSerializer" />
        </property>
        <property name="valueSerializer">
            <bean class="org.springframework.data.redis.serializer.JdkSerializationRedisSerializer" />
        </property>
        <property name="hashValueSerializer">
            <bean class="org.springframework.data.redis.serializer.JdkSerializationRedisSerializer" />
        </property>
    </bean>
    <!-- Pub Producer -->
    <bean class="me.chyxion.tigon.redis.pub.support.PubProducerSupport" />
</beans>
