Reputation: 15
I am Using IBM WebSphere MQ. Whenever simultaneous users log in to the IBM MQ, when the second user comes and try to access the getqueue they receive 2100 0x00000834 MQRC_OBJECT_ALREADY_EXISTS
error. Kindly provide some suggestion.
Connect to MQ Manager:
mqQueueManager = new MQQueueManager(mqQueueManagerName);
Open Put Queue:
mqPutQueue = mqQueueManager.AccessQueue(mqRequestQueueName, MQC.MQOO_INQUIRE |
MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING);
Opening the ReplyTo Queue generates the error when the second user tries to connect. The First user's dynamic queue will be deleted when they disconnect. That Second user is unable to connect, until the first user closes the application:
mqGetQueue = mqQueueManager.AccessQueue(mqModelQueueName, MQC.MQOO_INPUT_SHARED ,
mqQueueManagerName, mqReplyQueueName, "");
Upvotes: 1
Views: 395
Reputation: 31832
You are probably specifying the dynamic queue name incorrectly.
To provide the greatest flexibility to developers, WebSphere MQ allows a choice between selecting the exact name you want for a dynamic queue or letting WebSphere MQ generate unique names automatically. If you want WebSphere MQ to generate the name for you, make sure the name you pass in is short enough to allow WMQ to append additional characters, and specify an asterisk as the last character in the DynamicQName
field. This is explained in the docs in a section called Creating Dynamic Queues which reads as follows:
You can specify the name of the dynamic queue that you create in three ways:
DynamicQName
field of the
MQOD structure. DynamicQName
field. Do not specify a single asterisk () for
the dynamic queue name. DynamicQName
field.Based on the behavior you are describing, I'm guessing there's no asterisk in the name that you are passing to WMQ. It therefore assumes you want to explicitly specify the name and does exactly what you specified, although perhaps not what you intended.
To get the behavior you expect, make sure the value you pass for mqReplyQueueName
is a single asterisk (the '*
' character), or is a string of less than 33 characters that ends with an asterisk.
Upvotes: 1