我需要创建一个仅用于从 CI/CD 工具创建队列的用户。
<permission type="createDurableQueue" roles="amq, opadmin"/>
<permission type="deleteDurableQueue" roles="amq"/>
<permission type="createAddress" roles="amq, opadmin"/>
<permission type="deleteAddress" roles="amq, opadmin"/>
<permission type="consume" roles="amq, developer"/>
我得到以下错误
[amq-broker@x01sipscnaq1a bin]$ ./artemis queue create --auto-create-address --durable --user opadmin --password xxxxxxxx --anycast --preserve-on-no-consumers --url tcp:/ /10.91.xxx.xxx:61716 线程“主”ActiveMQSecurityException [errorType=SECURITY_EXCEPTION 消息=AMQ119213:用户:opadmin 没有队列activemq.management.383ccac9-0084-4c44-8f23-7f5c44f7b0dc 的权限='CONSUME'地址activemq.management.383ccac9-0084-4c44-8f23-7f5c44f7b0dc.activemq.management.383ccac9-0084-4c44-8f23-7f5c44f7b0dc]
所以改为
<permission type="createDurableQueue" roles="amq, opadmin"/>
<permission type="deleteDurableQueue" roles="amq"/>
<permission type="createAddress" roles="amq, opadmin"/>
<permission type="deleteAddress" roles="amq, opadmin"/>
<permission type="consume" roles="amq, developer, opadmin"/>
它进入没有错误,但挂起(等待超过 30 分钟)
[amq-broker@x01sipscnaq1a bin]$ ./artemis queue create --silent --auto-create-address --durable --user opadmin --password xxxxxx --anycast --name TestTorture --preserve-on-no-消费者 --url tcp://10.91.xxx.xxx:61716 --verbose 执行 org.apache.activemq.artemis.cli.commands.queue.CreateQueue 队列创建 --silent --auto-create-address --durable - -user opadmin --password xxxxxx --anycast --name TestTorture --preserve-on-no-consumers --url tcp://10.91.xxx.xxx:61716 --verbose Home::/opt/redhat/amq- broker-7.1.0-hf8,实例::/opt/redhat/amq-config/cn_soi/broker2b ^C[amq-broker@x01sipscnaq1a bin]$