0
votes

I have two MQ queue manager with same queue names configured. Both are configured to send data to different servers. Currently queue manager(QM1) is stopped(status Ended Immediately) and QM2 is running

Now my program opens the queue and sends data. It doesnot specify queue manager name. When I execute the program, MQ connection request returns error 2059.

My questions are:

  1. What happens when multiple queue managers have same queue name?
  2. How to tackle situation without changing the code?

Please forgive if the description is vague. It would be helpful if anyone provide links so that newbie like me can learn something.

Thanks

2
How did you send the message first to the queue of Queue manager 1 and then to queue manager 2. I also want to do the same using JMS? stackoverflow.com/questions/46897265/…. Any help please?Alagammal P

2 Answers

2
votes

It would be helpful if could provide details on your application. Whether it's using server bindings or client mode connection to queue manager. What version of MQ are you using?

The below information is valid for MQ v7.x:

If you are using client mode then you can use multiple CONNNAMEs to connect. If one queue manager is down, your application will connect to next queue manager in CONNAME list. One of the simplest way to do when using client mode connection is to define MQSERVER environment variable and specify multiple CONNNAMEs.

SET MQSERVER=<channel name>/TCP/host1(port1), host2(port2)

For example when both queue managers are on local host:

SET MQSERVER=MYSVRCONCHN/TCP/localhost(1414),localhost(1415)

In server bindings mode if queue manager name is not specified, then application will attempt to connect to the default queue manager. If the default queue manager is down, then 2059 is thrown.

1
votes

Your explaination doesn't provide clarity about your requirements.

You wrote:

My questions are 1. What happens when multiple queue managers have same queue name.

Nothing. Its a normal scenario. Different queue managers may have queues with same name and it doesn't create any ambiguity. Although, scenario will be a little different when the queue managers are in same cluster and the queue is also a cluster queue. Then everything will depend on requirements and design.

You wrote:

2. How to tackle situation without changing the code

  1. Run the queue manager which is stopped.

You wrote:

Now my program opens the queue and sends data. It doesnot specify queue manager name.

What application are you using?For a client application, you access a queue using an object of queue manager. I am asssuming that you are using an application(client) which doesn't take queue manager details from you, only takes queue details. And may be the queue manager is hard coded within the code. And it sends the message first to the queue of Queue manager 1 and then to queue manager 2. But, in your case queue manager 1 is down.

If above is the case, then the application's code needs to be changed. You should have exception handling in such a way that it executes the code for sending the message to the second queue manager even though the first lines of code throws error.