记得上下班打卡 | git大法好,push需谨慎

Commit 95699fce authored by 胡佳晨's avatar 胡佳晨

修改 redis队列消费指定 db

parent 317f8caa
......@@ -4,6 +4,7 @@ import com.liquidnet.common.cache.redis.config.AbstractRedisConfig;
import com.liquidnet.common.cache.redis.config.RedisConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
......@@ -20,10 +21,17 @@ import org.springframework.stereotype.Component;
public final class RedisUtil extends AbstractRedisUtil{
@Autowired
private RedisConfig redisConfig;
@Value("${spring.profiles.active:prod}")
private String prefix;
@Override
public String fillingKey(String key) {
return prefix.equals("prod") ? key : prefix.concat(":").concat(key);
}
@Override
public int getDbs() {
// log.info("redisConfig.totalDbs===",redisConfig.totalDbs);
log.info("redisConfig.totalDbs:{},prefix:{}===", redisConfig.totalDbs, prefix);
return redisConfig.totalDbs;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment