redis 分布式锁处理

 

import java.nio.charset.Charset;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.RedisStringCommands;
import org.springframework.data.redis.connection.ReturnType;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.types.Expiration;
import org.springframework.stereotype.Component;


@Component
public class RedisDistributedLockUtil {

    private final Logger logger = LoggerFactory.getLogger(RedisDistributedLockUtil.class);

    @Autowired
    private RedisTemplate redisTemplate;

    private static final String UNLOCK_LUA;

//静态代码块lua脚本   

 static {
        StringBuilder sb = new StringBuilder();
    

你可能感兴趣的:(缓存)