After storing the value of redis in Java, the value cannot be obtained, so you can save it to redis, but take out the value of key as null.

after saving the value of redis in Java, the value cannot be fetched. You can save it to redis, but the value of key taken out is null

.
@Autowired
private JedisClient jedisClient;

//redis redis
jedisClient.hset("INDEX_CONTENT", cid+"", JsonUtils.objectToJson(list));

// jsonNull
String json = jedisClient.hget(INDEX_CONTENT, cid+"");

xml profile for redis

    <!-- redis -->
    <bean id="jedisPool" class="redis.clients.jedis.JedisPool">
        <constructor-arg name="host" value="192.168.87.128"/>
        <constructor-arg name="port" value="6379"/>
    </bean>
    <!-- spring -->
    <bean id="jedisClientPool" class="com.taotao.jedis.JedisClientPool"/>

excuse me, this problem lies in the scanning place

May.22,2021

second line of code: use the string "INDEX_CONTENT" as key store

Line 3: use the constant INDEX_CONTENT to get

as key.

confirm the values of these two


Thank you. The problem is written as INDEX_CONTENT, but the value of INDEX_CONTENT is the "INDEX_CONTENT" of the string. It feels like the two are supposed to be the same, but they don't work

.
Menu