activemq-artemisactivemq-cpp

Connecting to ActiveMQ Artemis from CMS client requires CREATE_NON_DURABLE_QUEUE permission


I need to connect to a customer's Artemis MQ broker from a C++ application (Linux environment). I have no administrative access to the broker. Previously I have been able to use the CMS Client library (https://activemq.apache.org/components/cms/) successfully for this purpose to different brokers. Now I run into the following problem even with the Hello World example attached to the client package:

connectionFactory->createConnection() executes well (with correct username and password parameters), but connection->start() fails on the next line with the message below:

AMQ229213: User: ******** does not have permission='CREATE_NON_DURABLE_QUEUE' for queue d002d98a-4343-4f0a-ad0d-cf9a6941b36d on address ActiveMQ.Advisory.TempQueue
        FILE: org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection.convertException(OpenWireConnection.java), LINE: 461
        FILE: org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection.act(OpenWireConnection.java), LINE: 373
        FILE: org.apache.activemq.artemis.utils.actors.ThresholdActor.doTask(ThresholdActor.java), LINE: 73
        FILE: org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java), LINE: 68
        FILE: org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java), LINE: 57
        FILE: org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java), LINE: 32
        FILE: org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java), LINE: 68
        FILE: java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java), LINE: 1136
        FILE: java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java), LINE: 635
        FILE: org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java), LINE: 118
        FILE: activemq/core/ActiveMQConnectionFactory.cpp, LINE: 360

I could not find any related information on the internet. The broker admin insists that I need to change the client so that it does not try to create any kind of queues - which I have no intention to do but seems inevitable.


Solution

  • The client is registering with the broker in order to receive advisories on various destination creation events as indicated by the name of the destination it is being rejected from.

    To disable this you need to turn off watch of advisories using the connection option here.

    connectionFactory.setWatchTopicAdvisories(false);
    

    Or if I recall correctly it can be set on the connection URI via:

    ?connection.watchTopicAdvisories=false