Author |
Message
|
NotMe |
Posted: Wed Dec 02, 2009 9:27 am Post subject: How does an Application connect to an MQ Cluster? |
|
|
Apprentice
Joined: 25 Nov 2009 Posts: 26
|
From a programming perspective how does an application connect to a MQ Cluster? Does it connect to a specific Queue Manager and queue in that cluster? And if so what happens if that Queue Manager goes down? Can it establish a connection with other Queue Managers in the same cluster? How does this work? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Dec 02, 2009 9:34 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There are one of two answers, you can choose which one you prefer better.
1) It's all magic.
2) It works exactly as documented. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 02, 2009 9:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
1) It's all magic.
2) It works exactly as documented. |
I've always thought it was both.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
NotMe |
Posted: Wed Dec 02, 2009 9:46 am Post subject: |
|
|
Apprentice
Joined: 25 Nov 2009 Posts: 26
|
MQJeff you are an MQJerk. If I could find docs to answer my question I would not have posted. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 02, 2009 9:48 am Post subject: Re: How does an Application connect to an MQ Cluster? |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
NotMe wrote: |
From a programming perspective how does an application connect to a MQ Cluster? |
It doesn't.
NotMe wrote: |
Does it connect to a specific Queue Manager and queue in that cluster? |
No. Because no application connects to a queue. Ever.
NotMe wrote: |
And if so what happens if that Queue Manager goes down? |
The connection breaks. Just like always.
NotMe wrote: |
Can it establish a connection with other Queue Managers in the same cluster? |
If it wants to. Again, it's your choice.
NotMe wrote: |
How does this work? |
However you design & code it to, using the documented facilities.
It sounds a lot like you're trying to use a cluster as a high availability failover solution for your application. Even the briefest search through this section of the forum will yield any number of discussions why this is not a good idea. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 02, 2009 9:49 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
NotMe wrote: |
If I could find docs to answer my question I would not have posted. |
Someone's taken the Application Programming Guide & the Clusters manual out of the InfoCenter?
They're there when I click the link.....
...and even if you couldn't find them, a review of the section in which you posted this would have told you what I've summarised above. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Dec 02, 2009 11:53 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
From a programming perspective how does an application connect to a MQ Cluster? |
Apps make use of a set of API calls to interact with things MQ.
MQCONNect is used to make contact with a queue manager; MQOPEN is used to open an object, like a queue.
MQPUT and MQGET are used to put messages into a queue, and get messages from a queue.
Quote: |
Does it connect to a specific Queue Manager and queue in that cluster? |
Connections are to a specific queue manager. That qmgr may be part of a queue manager cluster, which means that it knows the existence of clustered queues.
Quote: |
And if so what ha ppens if that Queue Manager goes down? Can it establish a connection with other Queue Managers in the same cluster? |
A client channel table may be defined to offer several alternate qmgrs in the event of one qmgr becoming unavailable. The application will discover the qmgr failure on the next MQ call. It can then attempt to MQCONNect to one of the other qmgrs named in the table.
Quote: |
How does this work? |
Perfectly. Amazingly so. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Dec 02, 2009 4:06 pm Post subject: Re: How does an Application connect to an MQ Cluster? |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
NotMe wrote: |
From a programming perspective how does an application connect to a MQ Cluster? |
The same method as it uses to connect to a queue manager that is not in a MQ cluster.
Quote: |
Does it connect to a specific Queue Manager and open a queue in that cluster? |
Yes, apps connect to a specific qmgr of their choosing. Usually this is configured in the app (ie. not hardcoded in the source). Usually instances of apps are not specifically aware that the queue they are opening is clustered or not. ie. MQ is a black box that takes care of message routing and delivery.
Quote: |
And if so what happens if that Queue Manager goes down? |
The connection becomes invalid. The next call the MQ will return a meaningful ReasonCode.
Quote: |
Can it establish a connection with other Queue Managers in the same cluster? |
Yes, but it depends where they are located (same box as app or different box) and how the app connects to MQ (client or binding mode).
Quote: |
How does this work? |
Do some reading of the MQ App Prog Guide and MQ App Prog Ref. _________________ Glenn |
|
Back to top |
|
 |
Gaya3 |
Posted: Thu Dec 03, 2009 1:52 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
NotMe wrote: |
MQJeff you are an MQJerk |
MQGenius too.... thats the way he is _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
NotMe |
Posted: Thu Dec 03, 2009 4:44 am Post subject: |
|
|
Apprentice
Joined: 25 Nov 2009 Posts: 26
|
Thanks for the help. I've been an MQ admin by default for the last three weeks and all of this is very confusing. From what I understand MQ Cluster is more of a load balancer than an HA solution. If your application must make a connection to a specific queue manager than that is a single point of failure. I assume the multi-instance Queue Manager works the same way. The application must connect to a specific Queue Manager and if that queue manager is unavailable the connection fails. The only way you get to switch over to the stand-by queue manager is if the connection is via another queue manager and not an application. This is MQ stuff is very confusing and not much fun... |
|
Back to top |
|
 |
exerk |
Posted: Thu Dec 03, 2009 5:09 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
NotMe wrote: |
...This is MQ stuff is very confusing and not much fun... |
Stick with it, as your understanding increases so will your pleasure in the product - you'll get the bug!
One word to the wise however - flinging insults when you are trying to obtain help is never a good idea. We can sympathise with your frustrations (you are in the same position that many people that frequent this site have also been in), but just putting 'mq cluster' into Google returned ten choices including the Redbook, so you'll have to forgive people if they are a little sceptical about the amount of research you may have done. _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
mvic |
Posted: Thu Dec 03, 2009 5:15 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
NotMe wrote: |
Thanks for the help. I've been an MQ admin by default for the last three weeks and all of this is very confusing. From what I understand MQ Cluster is more of a load balancer than an HA solution. |
It's several things.
- a lookup service for queues that have been added to the cluster.
- provides local load balancing between channels usable as routes to instances of the queue.
- if used by correctly-coded clients in conjunction with Client Channel Definition Table files, can be regarded part of an HA solution for putter applications.
- via automatic message reallocation, some of the effects of queue manager downtime is worked around.
Quote: |
If your application must make a connection to a specific queue manager than that is a single point of failure. |
Yes, but see above. Via CCDTs there is some HA provision for putter applications. For getter applications then yes this does not help.
There are single points of failure in pretty much any system. How hard you work or how much you can spend working around these is a function of how important uptime is to the system requirements. Are there any details you are at liberty to share about your uptime requirements please?
Quote: |
I assume the multi-instance Queue Manager works the same way. The application must connect to a specific Queue Manager and if that queue manager is unavailable the connection fails. The only way you get to switch over to the stand-by queue manager is if the connection is via another queue manager and not an application. This is MQ stuff is very confusing and not much fun... |
This is really not how multi-instance queue managers work.
To get into the subject I would suggest half an hour or so searching the MQ 7.0.1 Information Center for terms like "client reconnect", "multi instance", "shared file system", "switchover", and "standby".
It might be better to open a new thread for this, but I'm sure people here will have answers to the questions that you have about this matter. |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Dec 03, 2009 6:28 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
MQJeff you are an MQJerk |
My personal experience: technical folks, however knowledgeable and gifted, are often perceived as rude or insensitive.
These traits can be annoying, especially for those in crisis. Frequently, the more knowledgeable and gifted, the more they are perceived as rude... (Less knowledgeable folks are perceived as cute, but harmless.)
Please, oh please, don't take this personally. I'm certain it wasn't intentional. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Dec 03, 2009 6:34 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
NotMe wrote: |
I've been an MQ admin by default for the last three weeks and all of this is very confusing. |
I trust you've arranged for some formal training, especially as you're already a long way from the shallow end of WMQ. Which is a large & complex product often causing confusion.
NotMe wrote: |
From what I understand MQ Cluster is more of a load balancer than an HA solution. |
Yes.
NotMe wrote: |
If your application must make a connection to a specific queue manager than that is a single point of failure. |
Yes.
NotMe wrote: |
The only way you get to switch over to the stand-by queue manager is if the connection is via another queue manager and not an application. |
No. Connection activity is controlled by the application. If it detects a failed connection it must respond appropriatly (you've been given a nudge towards CCDT).
Even if the connection is via "another queue manager" it doesn't swap the way I think you think it will.
NotMe wrote: |
This is MQ stuff is very confusing and not much fun... |
This is why they call it work. Though personaly I find it fun, but I like WMQ clusters. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Dec 03, 2009 6:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
exerk wrote: |
One word to the wise however - flinging insults when you are trying to obtain help is never a good idea. |
Do remember that we're all volunteers here with day jobs, so responses can be a little curt. There's a thread in the "New to MQ" section that might be worth a read. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|