a13707331174 opened a new issue #1696: 启用acl时,发送消息报RemotingTooMuchRequestException URL: https://github.com/apache/rocketmq/issues/1696 我使用rocketmq 4.6.0版本,当broker没有开启acl时,发送消息正常. 当开启acl时,若客户端没有传RPCHook时,还能报AclException, 但是传了RPCHook之后, 客户端就会报 RemotingTooMuchRequestException: sendDefaultImpl call timeout. plain_acl.yml使用的是默认配置: ``` globalWhiteRemoteAddresses: - 10.10.103.* - 192.168.0.* accounts: - accessKey: RocketMQ secretKey: 12345678 whiteRemoteAddress: admin: false defaultTopicPerm: DENY defaultGroupPerm: SUB topicPerms: - topicA=DENY - topicB=PUB|SUB - topicC=SUB groupPerms: - groupA=DENY - groupB=PUB|SUB - groupC=SUB - accessKey: rocketmq2 secretKey: 12345678 whiteRemoteAddress: 192.168.1.* admin: true ``` 客户端代码; ```java private static void sendWithAcl() { try { JSONObject json = new JSONObject(); json.put("name", "Alice"); DefaultMQProducer producer = new DefaultMQProducer("groupB",getAclRPCHook()); producer.setNamesrvAddr("10.1.245.34:9876"); producer.setInstanceName(UUID.randomUUID().toString()); producer.setVipChannelEnabled(false); producer.start(); Message msg = new Message("topicB", json.toJSONString().getBytes(Charsets.UTF_8)); producer.send(msg); } catch (Exception e) { e.printStackTrace(); } } private static RPCHook getAclRPCHook() { return new AclClientRPCHook(new SessionCredentials(ACL_ACCESS_KEY, ACL_SECRET_KEY)); } private static final String ACL_ACCESS_KEY = "RocketMQ"; private static final String ACL_SECRET_KEY = "12345678"; ``` 怎么才能正确的发送消息呢?
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
