user3379014
user3379014

Reputation: 15

MQRC_OBJECT_ALREADY_EXISTS error code 2100

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

Answers (1)

T.Rob
T.Rob

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:

  • Give the full name that you want in the DynamicQName field of the MQOD structure.
  • Specify a prefix (fewer than 33 characters) for the name, and allow the queue manager to generate the rest of the name. This means that the queue manager generates a unique name, but you still have some control (for example, you might want each user to use a certain prefix, or you might want to give a special security classification to queues with a certain prefix in their name). To use this method, specify an asterisk () for the last non-blank character of the DynamicQName field. Do not specify a single asterisk () for the dynamic queue name.
  • Allow the queue manager to generate the full name. To use this method, specify an asterisk (*) in the first character position of the 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

Related Questions