php - redis存储的key前面都带有\xAC\xED\x00\x05t\x00

查看:621
本文介绍了php - redis存储的key前面都带有\xAC\xED\x00\x05t\x00的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

存入的是md5加密的key,xACxEDx00x05tx00 86512b86d4747acac5524c4a1f76469f,存储后前面带了串东西。根据百度设置了keySerializer也没用,求解

<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate"

    p:connection-factory-ref="connectionFactory"> 
    <property name="keySerializer">  
        <bean class="org.springframework.data.redis.serializer.StringRedisSerializer" />  
    </property>  

</bean>

解决方案

    <bean id="redisTemplate"
          class="org.springframework.data.redis.core.RedisTemplate"
          p:connection-factory-ref="connectionFactory"
          p:defaultSerializer-ref="stringRedisSerializer"/>

    <bean id="stringRedisSerializer"
          class="org.springframework.data.redis.serializer.StringRedisSerializer"/>

这篇关于php - redis存储的key前面都带有\xAC\xED\x00\x05t\x00的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆