Ismail Anjrini
Ismail Anjrini

Reputation: 23

IBM MQ - I can't create topic doesn't start with DEV. on docker version

I have installed the docker version of IBM MQ based on the following link

https://developer.ibm.com/tutorials/mq-connect-app-queue-manager-containers/

Then I created new topic with the following specs: Name: PROD.TEST Topic string: dev/test/

Then from C# client I am using dev/test/ to create subscriber to the created topic:

destination = sessionWMQ.CreateTopic(env.Conn.topic_name); subscriber = sessionWMQ.CreateConsumer(destination);

For some reason if the Topic name doesn't start with DEV. the second line throws the following exception:

XMSException caught: IBM.XMS.IllegalStateException: Failed to subscribe to topic dev/test/ using MQSUB. There may have been a problem creating the subscription due to it being used by another message consumer. Make sure any message consumers using this subscription are closed before trying to create a new subscription under the same name.

Linked Exception : CompCode: 2, Reason: 2035

Upvotes: 0

Views: 528

Answers (1)

David Ware
David Ware

Reputation: 301

To get you started quickly, container image of MQ's developer edition pre-authorises a user called "app" to be able to connect to the queue manager and access a set of predefined queues and topics. These are the DEV.* queues and the "dev/" branch of the topic tree through the DEV.BASE.TOPIC definition. This is explained here

You can then build on this by adding queues and topics and granting access to these as you require.

To do this with MQ's CLI (runmqsc) you would use the SET AUTHREC command. Or to use the web interface you would click on the configuration of the new topic and select the security tab. You'll need to grant publish or subscribe authority depending on what the application wants to do.

enter image description here

Obviously, this just gets you going, as you move forward you'll want to review the security requirements and decide how to configure MQ to provide this.

Upvotes: 1

Related Questions