Skip to content

Commit

Permalink
[ISSUE #5941] Add proxyConfig enableAclRpcHookForClusterMode
Browse files Browse the repository at this point in the history
* Add proxyConfig `enableAclRpcHookForClusterMode` because not all the proxy needs to bring acl info
  • Loading branch information
drpmma committed Feb 16, 2023
1 parent 01d0b0c commit 9fc5038
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ public class ProxyConfig implements ConfigFile {

private boolean enableACL = false;

private boolean enableAclRpcHookForClusterMode = false;

private boolean useDelayLevel = true;
private String messageDelayLevel = "1s 5s 10s 30s 1m 2m 3m 4m 5m 6m 7m 8m 9m 10m 20m 30m 1h 2h";
private transient Map<Integer /* level */, Long/* delay timeMillis */> delayLevelTable = new ConcurrentHashMap<>();
Expand Down Expand Up @@ -927,6 +929,14 @@ public void setEnableACL(boolean enableACL) {
this.enableACL = enableACL;
}

public boolean isEnableAclRpcHookForClusterMode() {
return enableAclRpcHookForClusterMode;
}

public void setEnableAclRpcHookForClusterMode(boolean enableAclRpcHookForClusterMode) {
this.enableAclRpcHookForClusterMode = enableAclRpcHookForClusterMode;
}

public boolean isEnableTopicMessageTypeCheck() {
return enableTopicMessageTypeCheck;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ public static DefaultMessagingProcessor createForLocalMode(BrokerController brok
}

public static DefaultMessagingProcessor createForClusterMode() {
return createForClusterMode(AclUtils.getAclRPCHook(ROCKETMQ_HOME + MixAll.ACL_CONF_TOOLS_FILE));
RPCHook rpcHook = null;
if (ConfigurationManager.getProxyConfig().isEnableAclRpcHookForClusterMode()) {
rpcHook = AclUtils.getAclRPCHook(ROCKETMQ_HOME + MixAll.ACL_CONF_TOOLS_FILE);
}
return createForClusterMode(rpcHook);
}

public static DefaultMessagingProcessor createForClusterMode(RPCHook rpcHook) {
Expand Down

0 comments on commit 9fc5038

Please sign in to comment.