使用springboot 2.0时,如何从RedisTemplate获取Jedis客户案例?以下内容不起作用

时间:2019-04-16 10:00:32

标签: spring-boot jedis

String result = (String) redisTemplate.execute((RedisCallback<String>) connection -> {
        JedisCommands jedisCommands = (JedisCommands) connection.getNativeConnection();
        return jedisCommands.set(lockKey, requestId, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME,expireTime);
    });

0 个答案:

没有答案