Author |
Message
|
jmeier |
Posted: Tue Nov 19, 2002 6:30 am Post subject: [Solved]Queue Manager and Clustered Environments |
|
|
Apprentice
Joined: 30 Aug 2002 Posts: 46 Location: Minneapolis
|
We are in the process of trying to move our workflow project from a development to stage environment. I noticed that I am specifying a queue manager name in my code, when in reality we just want to specify a queue name and let the program find the appropriate queue depending on if it is running in the development or stage queue manager. We don't want to have to change the code as we promote it thru the environments.
Now for the issue I am running into. If I remove the following command:
Set MQQueueMgr = MQSess.AccessQueueManager("QM_mpclarifydev")
I receive the following error:
"Run-time error '91'. Object variable or with block variable not set".
The queues and QM's are running in a clustered environment on NT. Any thoughts as to why this error is occuring and why I need to specify the QM name would be appreciated.
Thanks. _________________ Joe Meier
Last edited by jmeier on Wed Mar 05, 2003 1:53 pm; edited 1 time in total |
|
Back to top |
|
 |
Vladimir |
Posted: Thu Nov 21, 2002 6:22 pm Post subject: |
|
|
 Acolyte
Joined: 14 Nov 2002 Posts: 73 Location: USA, CA, Bay Area
|
You have to create Queue Manager object, because only thourgh it you can get access to the actual queue. If you not "Set" it - it will stay "null" or Nothing (in VB) by default and you will get an exception when you try to access it's properties or methods.
There are two places when you actually can specify QManager name:
1. When you connect to some QManager
2. Whan you open a queue managed by previously opened QMngr
First step must be done. Second is optional. I mean, that when you open the queue you can specify QueueManager name and you will access the Queue on the particular QManager, but if you want to use MQ clustering - you shouldn't specify the queue manager name when you open the queue. MQS will the round-robin throught all shared (clustered) queues with the specified name.
In short: you have to find a place in you code where you open a Queue (not Queue Manager) and remove QM specification if you have it there. |
|
Back to top |
|
 |
vennela |
Posted: Thu Nov 21, 2002 11:38 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Vladimir:
You sure about this
Quote: |
but if you want to use MQ clustering - you shouldn't specify the queue manager name when you open the queue. |
I don't think so.
And you have also said this in the beginning of the post
Quote: |
You have to create Queue Manager object, because only thourgh it you can get access to the actual queue |
---
Venny |
|
Back to top |
|
 |
Vladimir |
Posted: Fri Nov 22, 2002 12:16 am Post subject: |
|
|
 Acolyte
Joined: 14 Nov 2002 Posts: 73 Location: USA, CA, Bay Area
|
vennela wrote: |
I don't think so. |
Venny, could you, please, explain your doubts?
May be I didn't explained it clearly, but if you want to send a message to MQ you should:
1. Open Queue Manager on some MQ Server
2. Open Queue specifying it's name and it's Queue Manager name (because queue can be located not on the queue manager you opened - it can be remote queue definition, queue shared in the clustered or alias to this kind of queues)
3. Put a message
4. Commit queue update
5. Close and destroy Queue and QM objects
If you don't agree with schema, could you, please, shre with us your approach?  |
|
Back to top |
|
 |
jmeier |
Posted: Fri Nov 22, 2002 5:51 am Post subject: |
|
|
Apprentice
Joined: 30 Aug 2002 Posts: 46 Location: Minneapolis
|
I added back in the following command to go to the 'default' QM:
Set MQQueueMgr = MQSess.AccessQueueManager("")
I have tried shutting down the Development QM and running the code to see if it would connect to the Stage QM, but it still wouldn't find the Queue. I thought that by specifying the connection in this manner, it would find the Queue. Any other thoughts as to why this may be happening. The development QM is set up as the default. Could this be causing the issue? _________________ Joe Meier |
|
Back to top |
|
 |
amittalekar |
Posted: Fri Nov 22, 2002 10:50 am Post subject: |
|
|
 Disciple
Joined: 03 Apr 2002 Posts: 166 Location: VA, USA
|
jmeier,
can u explain more about ur WF setUp?....are u using XML interface? |
|
Back to top |
|
 |
jmeier |
Posted: Fri Nov 22, 2002 11:10 am Post subject: |
|
|
Apprentice
Joined: 30 Aug 2002 Posts: 46 Location: Minneapolis
|
We are running the 2 QM's in question on Win 2000 servers. Normally we would only have 1 QM on each server, but currently we are trying to run both the stage and development environments on the same server. Both environments are setup on the server using clustering. Both QM's have the same queues, so that we don't have to change the code as we migrate thru the different environments. Currently I can access the development QM, which I believe is set up as the default.
We are using XML when dealing with the messages. _________________ Joe Meier |
|
Back to top |
|
 |
amittalekar |
Posted: Fri Nov 22, 2002 12:04 pm Post subject: |
|
|
 Disciple
Joined: 03 Apr 2002 Posts: 166 Location: VA, USA
|
ur setup seems a little confusing to me.....It is ideal to have different set up for development & "stage" (I guess "stage" is before production environment where user tests)....
We are using JMS support for putting & getting messages from queue. Here we don't have to code for QManager.......QManager is defined in QueueConnectionFactory using JMSAdmin utility.......In the code I look up for queue using this QueueConnectionFactory....
are u doing the same way? |
|
Back to top |
|
 |
jmeier |
Posted: Fri Nov 22, 2002 12:07 pm Post subject: |
|
|
Apprentice
Joined: 30 Aug 2002 Posts: 46 Location: Minneapolis
|
Unfortunately, I am using Visual Basic when I connect and read from the queue. _________________ Joe Meier |
|
Back to top |
|
 |
amittalekar |
Posted: Fri Nov 22, 2002 12:11 pm Post subject: |
|
|
 Disciple
Joined: 03 Apr 2002 Posts: 166 Location: VA, USA
|
Sorry Joe...
No experience with VB..... |
|
Back to top |
|
 |
Vladimir |
Posted: Fri Nov 22, 2002 1:35 pm Post subject: |
|
|
 Acolyte
Joined: 14 Nov 2002 Posts: 73 Location: USA, CA, Bay Area
|
Could you post the line of the code here that is producing an error? It should be line where you open a queue. |
|
Back to top |
|
 |
Ratan |
Posted: Fri Nov 22, 2002 2:01 pm Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
Quote: |
I added back in the following command to go to the 'default' QM:
Set MQQueueMgr = MQSess.AccessQueueManager("")
I have tried shutting down the Development QM and running the code to see if it would connect to the Stage QM, but it still wouldn't find the Queue. I thought that by specifying the connection in this manner, it would find the Queue. Any other thoughts as to why this may be happening. The development QM is set up as the default. Could this be causing the issue? |
Joe, That is the default behavior. You neednot specify the QM name only if it is the default QM, or else you have to specify a QM name to connect to.
-Laze |
|
Back to top |
|
 |
Ratan |
Posted: Fri Nov 22, 2002 2:06 pm Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
Vladimir Wrote -
Quote: |
2. Open Queue specifying it's name and it's Queue Manager name (because queue can be located not on the queue manager you opened - it can be remote queue definition, queue shared in the clustered or alias to this kind of queues)
|
If I am right, You should not do this unless you want your messages to be processed at a one of the 2 clustered QMs which host the queue.
-Laze |
|
Back to top |
|
 |
Ratan |
Posted: Fri Nov 22, 2002 2:13 pm Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
jmeier,
can you detail your architecture a little more, like if you are trying to put the messages from a 3rd QM which is a part of the cluster where you have your devel and Prod QMs. Other wise if you are trying to connect to QM locally and putting the message, they will always be served by the QM you connected to.
A thought, If I understand what you are trying to test, put disable the Queue you want to put the message to on your devel QM and then put the message on the queue, that will put the message on the queue of your Stage QM.
I believe you are getting what you asked for from MQ.
-Laze. |
|
Back to top |
|
 |
Vladimir |
Posted: Fri Nov 22, 2002 6:58 pm Post subject: |
|
|
 Acolyte
Joined: 14 Nov 2002 Posts: 73 Location: USA, CA, Bay Area
|
lazeknight wrote: |
If I am right, You should not do this unless you want your messages to be processed at a one of the 2 clustered QMs which host the queue. |
Yes, you are right, usually you should not specify queue manager name when you open the queue. In some rare cases you can do this, but it is better to avoid such designs, because it will be difficult to extend it later.  |
|
Back to top |
|
 |
|