Author |
Message
|
vmbala76 |
Posted: Wed Oct 31, 2007 12:22 am Post subject: Application connecting two different QMGR |
|
|
Newbie
Joined: 28 Aug 2006 Posts: 7
|
The scenario i have,
Java application is using binding method to connect the QMGR for every put and get the message and disconnects at the end.
Can I use the two different QMGR in the same MQServer. Binding mode can the below scenario is possible.
1. Connecting QMGR1 and do the put and get operation then disconnects.
2. Connecting QMGR2 and do the put and get operation then disconnects.
Thanks. |
|
Back to top |
|
 |
David.Partridge |
Posted: Wed Oct 31, 2007 1:08 am Post subject: |
|
|
 Master
Joined: 28 Jun 2001 Posts: 249
|
A couple of comments:
Yes, you can do that assuming both QMs are on the same machine as your application, and that you truly do disconnect (assuming this is all on one thread). Connection pooling may mean that you haven't disconnected when you think you have especially in JMS applications.
WHY are you doing that - an MQCONN. MQOPEN, MQPUT, MQCLOSE, MQDISC pattern is well expensive. It is a far better practice to keep your connections and queues open, and put messages whenever you need to. ISTR that this can be done without problems if you use a different thread for each QM so long as you are running on distributed platforms. This does of course somewhat complicate the application design!
I'm open to correction on this matter though as my memory isn't perfect.
(The second sign of old age is loosing your memory, I can't remember what the first one is!). _________________ Cheers,
David C. Partridge |
|
Back to top |
|
 |
Vitor |
Posted: Wed Oct 31, 2007 1:26 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
David.Partridge wrote: |
I'm open to correction on this matter though as my memory isn't perfect.
(The second sign of old age is loosing your memory, I can't remember what the first one is!). |
Sounds right to me, though this may just mean I'm due the chair next to yours in the retirement home for bemused I.T. professionals.
I'd certainly not use that connect / disconnect pattern, which is expensive. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
vmbala76 |
Posted: Wed Oct 31, 2007 2:58 am Post subject: |
|
|
Newbie
Joined: 28 Aug 2006 Posts: 7
|
sorry. Its not one thread(scenario 1 &2). One thread will execute the scenario 1 based on certain condition and another
thread will execute scenario 2.
Thread 1 : scanario 1 - connecting QMGR1 and disconnects.
Thread 2 : scenario 2 - Connecting QMGR2 and disconnects.
application using Binding option so there is no port and channel used.
Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 31, 2007 3:53 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You're really doing entirely the wrong thing here.
1) Connect & disconnect from a qmgr as little as possible. This makes me the third person to tell you this.
2) Why do you need to connect to two qmgrs? Connect to one, put to two different queues, one that uses MQ Networking to deliver the message to the other qmgr!
What problem are you actually trying to solve? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
vmbala76 |
Posted: Wed Oct 31, 2007 7:17 pm Post subject: |
|
|
Newbie
Joined: 28 Aug 2006 Posts: 7
|
Thanks jefflowrey.
Actually for the same thread, we put the message and waiting max 50 secs for the response. moreover the same QMGR used by 3 different applications. we decided to avoid the maximum connections reached, everytime we are disconnecting the QMGR.
Now MQ team has come up with seperate QMGR for particular Queue operations.
As a application - MQ connectivity, I am worried, will the connectivity to two different QMGR is possible in simulataneous two thread as my below sceanrio(Binding option). |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Oct 31, 2007 7:48 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
This (multiple qmgrs in bindings connection) is entirely going the wrong direction.
The rule as I understant it is:
- If in bindings connect to ONE qmgr only.
All other needs should be met by extra local and remote queues on this ONE qmgr
- If in a java environment in bindings and specially in a J2EE environment remember that you will only be allowed to connect to ONE qmgr at any time in the same JVM.
This means you cannot have 2 different threads connecting concurrently in bindings to 2 different qmgrs... If you need that you need a client connection.
- Keep your qmgr queue naming schemes and authorizations separate by applications
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
manicminer |
Posted: Fri Nov 02, 2007 2:10 am Post subject: |
|
|
 Disciple
Joined: 11 Jul 2007 Posts: 177
|
fjb_saper wrote: |
This (multiple qmgrs in bindings connection) is entirely going the wrong direction.
The rule as I understant it is:
- If in bindings connect to ONE qmgr only.
All other needs should be met by extra local and remote queues on this ONE qmgr
- If in a java environment in bindings and specially in a J2EE environment remember that you will only be allowed to connect to ONE qmgr at any time in the same JVM.
This means you cannot have 2 different threads connecting concurrently in bindings to 2 different qmgrs... If you need that you need a client connection.
- Keep your qmgr queue naming schemes and authorizations separate by applications
Enjoy  |
Are you 100% sure you cannot connect to more than one queue manager using bindings mode as of V6? The only reason I ask is that the MQ Explorer connects localy to several queue managers, each in its own thread, when you have multiple QM's defined on the machine. And AFAIK the Explorer just uses the standard MQ Java classes to do this  |
|
Back to top |
|
 |
Vitor |
Posted: Fri Nov 02, 2007 2:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
manicminer wrote: |
The only reason I ask is that the MQ Explorer connects localy to several queue managers, each in its own thread, when you have multiple QM's defined on the machine. And AFAIK the Explorer just uses the standard MQ Java classes to do this  |
I thought the Explorer used client connections......  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Nov 02, 2007 2:22 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
MQ Explorer can use client connections, but it doesn't for local qmgrs, unless you explicitly configure it to do so.
That is, it makes multiple bindings connections at startup to each local qmgr, that is set to automatically connect and be shown that is.
It's only for a tool like MQ Explorer that it makes any sense for any application to connect to more than one queue manager at a time, though.
No business application should ever connect to more than one queue manager.
EDIT: Well, unless it's acting as a gateway process between two network zones (DMZ/non-DMZ). Then, maybe. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Nov 02, 2007 2:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Don't know if that limitation still applies to java V6. I know I tried with java and MQ 5.3 CSD 4 (back when) and had a real hard time about it.
Are you sure that V6 is not just serializing its calls (pcf) by local qmgr ??
Note on how you don't have the folder's content open at the same time for multiple qmgrs...(display queues, channels etc...)
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Nov 02, 2007 2:30 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'm sure MQ Explorer has a cache of active MQQueueManager objects somewhere, and that it's not connecting/disconnecting every time you open or close a folder... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Nov 02, 2007 2:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
jefflowrey wrote: |
I'm sure MQ Explorer has a cache of active MQQueueManager objects somewhere, and that it's not connecting/disconnecting every time you open or close a folder... |
Doesn't need to do it everytime you switch folder, just every time you switch qmgr. Now whatever it keeps cached that is between MQExplorer and the pcf commands it issues... I'm sure better minds than mine have collaborated to give us the product we so appreciate...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Nov 02, 2007 2:58 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
MQ Explorer is simultaneoulsy connected to every Queue Manager that it claims to be connected to. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Nov 02, 2007 3:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
jefflowrey wrote: |
MQ Explorer is simultaneoulsy connected to every Queue Manager that it claims to be connected to. |
Then why is it not possible to create a queue filter over multiple qmgrs and display them and refresh them at once?
Ex queue 1 in qmgr 1, queue 3 in qmgr 2, queue 4 in qmgr 3 displayed and refreshed side by side?
Is it because it is intended to be used as an admin tool and NOT as a monitoring tool?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|