Skip to content

Commit

Permalink
camellia-redis-proxy support configure dynamic.conf.file.name in appl…
Browse files Browse the repository at this point in the history
…ication.yml to replace camellia-redis-proxy.properties
  • Loading branch information
caojiajun committed Feb 13, 2023
1 parent a4bda7e commit a4f9b6f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ camellia-redis-proxy:
- monitorPlugin
- bigKeyPlugin
- hotKeyPlugin
# config: #you can get this config from ProxyDynamicConf.java, priority less than camellia-redis-proxy.properties
# "k": v
##you can get this config from ProxyDynamicConf.java, priority less than camellia-redis-proxy.properties
##you can configure dynamic.conf.file.name here to replace camellia-redis-proxy.properties
# config:
# "dynamic.conf.file.name": "xxx.properties"
# "xxx": "yyy"
transpond:
type: local #local、remote、custom
local:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class ProxyDynamicConf {

private static Map<String, String> conf = new HashMap<>();
private static final Set<DynamicConfCallback> callbackSet = new HashSet<>();
private static final String fileName = "camellia-redis-proxy.properties";
private static String fileName = "camellia-redis-proxy.properties";

private static final ConcurrentHashMap<String, Integer> intCache = new ConcurrentHashMap<>();
private static final ConcurrentHashMap<String, Long> longCache = new ConcurrentHashMap<>();
Expand All @@ -44,6 +44,11 @@ public class ProxyDynamicConf {
public static void updateInitConf(Map<String, String> initConf) {
if (initConf != null && !initConf.isEmpty()) {
ProxyDynamicConf.initConf.putAll(initConf);
String fileName = initConf.get("dynamic.conf.file.name");
if (fileName != null) {
ProxyDynamicConf.fileName = fileName;
logger.info("ProxyDynamicConf use {} instead of camellia-redis-proxy.properties", fileName);
}
reload();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ camellia-redis-proxy:
- monitorPlugin
- bigKeyPlugin
- hotKeyPlugin
# config: #you can get this config from ProxyDynamicConf.java, priority less than camellia-redis-proxy.properties
# "k": v
##you can get this config from ProxyDynamicConf.java, priority less than camellia-redis-proxy.properties
##you can configure dynamic.conf.file.name here to replace camellia-redis-proxy.properties
# config:
# "dynamic.conf.file.name": "xxx.properties"
# "xxx": "yyy"
transpond:
type: local #local、remote、custom
local:
Expand Down
1 change: 1 addition & 0 deletions update-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* camellia-hbase support setting userName、password、tag of aliyun-lindorm in url
* camellia-redis-proxy optimize the failover logic of redis-cluster-slaves and redis-sentinel-slaves
* camellia-redis-proxy optimize the failover logic of redis-proxies and redis-proxies-discovery
* camellia-redis-proxy support configure dynamic.conf.file.name in application.yml to replace camellia-redis-proxy.properties

### update
* camellia-redis-proxy rename core upstream service
Expand Down
1 change: 1 addition & 0 deletions update-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* camellia-hbase支持url中设置userName和password以及aliyun-lindorm的标记
* camellia-redis-proxy优化了redis-cluster-slaves和redis-sentinel-slaves两种resource在有节点宕机下的failover逻辑
* camellia-redis-proxy优化了redis-proxies和redis-proxies-discovery两种resource在有节点宕机下的failover逻辑
* camellia-redis-proxy支持在application.yml中配置dynamic.conf.file.name来代替camellia-redis-proxy.properties文件

### 更新
* camellia-redis-proxy相关核心类进行了重命名(upstream部分)
Expand Down

0 comments on commit a4f9b6f

Please sign in to comment.