@Resource
private DistributedRedisLockTemplate lockTemplate;
String distributedKey="lockKey" ; DistributedLockCallback<String> callback = new DistributedLockCallback<String>() { @Override public String callback() throws Exception { return businessMethod(); } }; accessToken = lockTemplate.execute(callback, new WechatSchemeLockKey(distributedKey));
标签:String,redis,distributed,DistributedLockCallback,callback,锁试 From: https://www.cnblogs.com/niun/p/16711326.html