diff --git a/acl/src/main/java/org/apache/rocketmq/acl/PlainAccessValidator.java b/acl/src/main/java/org/apache/rocketmq/acl/PlainAccessValidator.java index 581237e9b14048b76b49b4f9b6b2437d851d823e..ef25a9c785b5e78c9fad26d5a32f28f0dc21c941 100644 --- a/acl/src/main/java/org/apache/rocketmq/acl/PlainAccessValidator.java +++ b/acl/src/main/java/org/apache/rocketmq/acl/PlainAccessValidator.java @@ -49,17 +49,18 @@ public class PlainAccessValidator implements AccessValidator { @Override public void validate(AccessResource accessResource) { + AuthenticationResult authenticationResult = null; try { - AuthenticationResult authenticationResult = aclPlugEngine.eachCheckAuthentication((AccessControl) accessResource); - if (authenticationResult.getException() != null) { - throw new AclPlugRuntimeException(String.format("eachCheck the inspection appear exception, accessControl data is %s", accessResource.toString()), authenticationResult.getException()); - } - if (authenticationResult.getAccessControl() == null || !authenticationResult.isSucceed()) { - throw new AclPlugRuntimeException(String.format("%s accessControl data is %s", authenticationResult.getResultString(), accessResource.toString())); - } + authenticationResult = aclPlugEngine.eachCheckAuthentication((AccessControl) accessResource); } catch (Exception e) { throw new AclPlugRuntimeException(String.format("validate exception AccessResource data %s", accessResource.toString()), e); } + if (authenticationResult.getException() != null) { + throw new AclPlugRuntimeException(String.format("eachCheck the inspection appear exception, accessControl data is %s", accessResource.toString()), authenticationResult.getException()); + } + if (authenticationResult.getAccessControl() == null || !authenticationResult.isSucceed()) { + throw new AclPlugRuntimeException(String.format("%s accessControl data is %s", authenticationResult.getResultString(), accessResource.toString())); + } } } diff --git a/acl/src/main/java/org/apache/rocketmq/acl/plug/PlainAclPlugEngine.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/PlainAclPlugEngine.java index bdee1be9242583651ad09d140ce48c1116aed7ac..c255b59e5b10ba7841f8030fdde466a7469e4b34 100644 --- a/acl/src/main/java/org/apache/rocketmq/acl/plug/PlainAclPlugEngine.java +++ b/acl/src/main/java/org/apache/rocketmq/acl/plug/PlainAclPlugEngine.java @@ -56,6 +56,7 @@ public class PlainAclPlugEngine { if (accessControlTransport == null) { throw new AclPlugRuntimeException("transport.yml file is no data"); } + log.info("BorkerAccessControlTransport data is : ", accessControlTransport.toString()); accessContralAnalysis.analysisClass(accessContralAnalysisClass); setBorkerAccessControlTransport(accessControlTransport); } diff --git a/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java b/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java index a6da44b641dcb57ffff36544c5218f4bbd5daf92..796b72ef273abe22ca74819f0946b678293a367c 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java @@ -1033,6 +1033,7 @@ public class BrokerController { public void registerServerRPCHook(RPCHook rpcHook) { getRemotingServer().registerRPCHook(rpcHook); + this.fastRemotingServer.registerRPCHook(rpcHook); } public RemotingServer getRemotingServer() { diff --git a/broker/src/main/resources/META-INF/service/org.apache.rocketmq.acl.AccessValidator b/broker/src/main/resources/META-INF/service/org.apache.rocketmq.acl.AccessValidator new file mode 100644 index 0000000000000000000000000000000000000000..422b1e7bcbcc93fcbe838b881383ddbecd0ad934 --- /dev/null +++ b/broker/src/main/resources/META-INF/service/org.apache.rocketmq.acl.AccessValidator @@ -0,0 +1 @@ +org.apache.rocketmq.acl.PlainAccessValidator \ No newline at end of file