hahchenchen commented on issue #413: No 4. add acl URL: https://github.com/apache/rocketmq/pull/413#issuecomment-412747863 方案2. 思路: 在该方案里,我们通过在客户端进行鉴权的方式,这里的客户端包括:producer和consumer 通过源码可以知道在客户端[producer | consumer]中,都会使用NettyRemotingClient类 的作为数据发送接口,并提供三个方法发送数据。通过在这个三个方法里添加 钩子类 hook 在数据 发送动作前提供鉴权操作。 使用: 用户在使用 rocketmq 时,如果要使用 鉴权 功能,则把提供一个 AclClientHook 并传递到 DefaultMQProducer, AclClientHook 提供对到鉴权查询的服务功能。这里的 AclClientHook 是一个 鉴权钩子,里面描述了鉴权中心的访问接口 AclService,不规范具体实现。 提供对到鉴权查询的服务功能。这里的AclClientHook,如下: RpcHook acl = new AclClientHook(); DefaultMQProducer producer = new DefaultMQProducer("please_rename_unique_group_name", ack); 这里我们提供了一个基于mysql的单应用的鉴权中心: ACLCenter。
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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
