RocketMQ ACL 功能测试

测试背景

基于测试版本为RocketMQ 4.8.0版本,主要是测试ACL功能

首先上配置文件:

accounts:
- accessKey: rocketmq
  secretKey: 12345678123
  whiteRemoteAddress:
  admin: false
  defaultTopicPerm: DENY
  defaultGroupPerm: DENY
  topicPerms:
  - topicA=DENY
  - topicB=PUB|SUB
  - topicC=SUB
  - topicD=PUB
  groupPerms:
  # the group should convert to retry topic
  - groupA=DENY
  - groupB=PUB|SUB
  - groupC=SUB
  - groupD=PUB

测试账号为rocketmq,topic 一共有5个,另外包含topicX,groupID也有5个,除了配置文件中包含的A-D还有groupX

生产测试

测试结果

生产者测试
Topic写入结果
topicA禁止写入
topicB写入成功
topicC写入成功
topicD写入成功
topicX写入成功

 

测试结论:

1、当配置topic无PUB权限时,无法往topic中写入数据
2、是否有权限写入数据和groupID无关
3、当topic没有在配置列表中,默认是能写入(感觉这个有点坑,权限没有管控到位)

消费测试

测试结果:

消费者测试(第一组)
TopicgroupID消费结果
topicAgroupA无法消费
topicBgroupA无法消费
topicCgroupA无法消费
topicDgroupA无法消费
topicAgroupB无法消费
topicBgroupB正常
topicCgroupB正常
topicDgroupB无法消费
topicAgroupC无法消费
topicBgroupC正常
topicCgroupC正常
topicDgroupC无法消费
topicAgroupD无法消费
topicBgroupD正常
topicCgroupD正常
topicDgroupD无法消费
消费者测试(第二组)
TopicgroupID消费结果
topicAgroupx无法消费
topicBgroupx正常
topicCgroupx正常
topicDgroupx无法消费
topicXgroupA无法消费
topicXgroupB无法消费
topicXgroupC无法消费
topicXgroupD无法消费
topicXgroupx无法消费

 

 

测试结果:

1、当配置了groupID,有SUB权限时能正常消费数据
2、配置列表topicPerm没有的topic,无论groupID是什么都无法消费
3、配置列表topicPerm的topic有SUB权限,无论groupID是什么都能正常消费

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

chensonga

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值