I tried following this tutorial: http://javakart.blogspot.in/2012/12/spring-data-redis-hello-world-example.html
My question is related to this: Weird redis key with spring data Jedis
I was able to solve the keys and hashkeys using the StringRedisSerializer .
<bean
id="stringRedisSerializer"
class="org.springframework.data.redis.serializer.StringRedisSerializer"/>
<bean
id="redisTemplate"
class="org.springframework.data.redis.core.RedisTemplate"
p:connection-factory-ref="jedisConnectionFactory"
p:keySerializer-ref="stringRedisSerializer"
p:hashKeySerializer-ref="stringRedisSerializer"
/>
However I found it a problem using a serializer for the value and hashvalue.
I tried adding this:
p:valueSerializer-ref="stringRedisSerializer"
p:hashValueSerializer-ref="stringRedisSerializer"
But an error prompted: "User cannot be cast to java.lang.String"
Can anyone share how to use a serializer for the value/hashvalue?