Author |
Message
|
Vitor |
Posted: Wed Dec 12, 2007 3:38 am Post subject: JMS applications & Clustered queues |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Okay, really newbie question here and I invite your ridicule but if you argue with someone long enough, and they're determined enough, they start to convince you by osmosis.
The Scenario:
There is a Java "thing" (application? bean?) running inside a Websphere Application server. The intention is that it will place messages onto a cluster queue for distribution across the other 3 queue managers on the cluster. All the queue managers concerned are running v6.0.2.1.
The "thing" developers are adamant that they have to have a remote queue to place messages onto because JMS can't directly use a clustered queue:
Quote: |
because there's nothing there to attach to |
Clearly they could have a remote queue which then points to a cluster alias and we all ride off into the sunset, but is that true? I thought JMS code could use cluster queues or has this Java stuff finally got to me? Or is the office party last night gaining it's revenge?
Be gentle with me.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
David.Partridge |
Posted: Wed Dec 12, 2007 4:01 am Post subject: |
|
|
 Master
Joined: 28 Jun 2001 Posts: 249
|
Certainly, my experience with Java applications is that they do have problems with putting to a QC under some circumstances and that you may need to define a cluster alias so they can see them.
DEF QR(CLUSALIAS) RNAME(' ') RQMNAME(' ')
if they then put to QN(name.of.clustered.queue) QMNAME(CLUSALIAS), all will be well.
Now the why of this abberation I'm not sure about. It could just be dodgy user application code, or perhaps and artefact of the internals of the MQ Java implementation. Perhaps someone better versed in MQ Java internals could comment? _________________ Cheers,
David C. Partridge |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Dec 12, 2007 6:04 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
I would have said that you could put to the cluster queue without having to do anything special.....except make sure you take care of the bindings to the queue. If the cluster queue actually has a copy on your queue manager, I believe the default is to bind to it and not put messages to other queues in the cluster.
Regarding "there's nothing there to attach to", I'm confused. I would have said you 'attach' to your local queue manager.... |
|
Back to top |
|
 |
rxm8778 |
Posted: Wed Dec 12, 2007 7:46 am Post subject: |
|
|
Apprentice
Joined: 15 Sep 2005 Posts: 37
|
To my knowledge, as long as your Websphere Application Server has connection factories defined to connect to one of the queue managers that belong the cluster, your message will get to its destination. If the cluster queue is local to the queue manager you connect to, I believe it will be favored.
Now if you are not connecting directly to a cluster queue manager, that's a different story and in that case I could see why you would need remote queue definitions to get to the actual cluster queues. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 12, 2007 7:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rxm8778 wrote: |
If the cluster queue is local to the queue manager you connect to, I believe it will be favored. |
Even on v6 where we've specified CLWLUSEQ(ANY)?
rxm8778 wrote: |
Now if you are not connecting directly to a cluster queue manager, that's a different story and in that case I could see why you would need remote queue definitions to get to the actual cluster queues. |
I can confirm that the queue manager connected to by the Java in this instance is a partial repository of the cluster in question. The same arguement has, according to others, been applied by the Java people even when the queue manager has been a full repository. If there's no remote queue they claim they can't put.
(Further investigation my end has revealed a lack of evidence in the form of reason codes, Java stack trace stuff or other material. It just seems to be a well known fact which the elders of the Java tribe pass on round the camp fire........) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
manicminer |
Posted: Wed Dec 12, 2007 8:36 am Post subject: |
|
|
 Disciple
Joined: 11 Jul 2007 Posts: 177
|
I don't think you should need to do anything special for either the MQ java classes or JMS (I don't have access to a QM to check right now!).
JMS and Java are just an MQ client, and should perform the same as any other MQ client with regards to putting messages! If you can put to it using a C client you should be able to with a JMS or Java one.
edit: if not I'd raise a PMR  |
|
Back to top |
|
 |
rxm8778 |
Posted: Wed Dec 12, 2007 8:59 am Post subject: |
|
|
Apprentice
Joined: 15 Sep 2005 Posts: 37
|
vitor wrote: |
Even on v6 where we've specified CLWLUSEQ(ANY)? |
If you specify ANY then the cluster queue local to the queue manager you are connecting to will not be favored. Other cluster queues residing on queue managers belonging to that cluster will be considered as well when the PUT is issued.
I found the following link:
http://www-1.ibm.com/support/docview.wss?uid=swg21116181
Apparently if the queue manager you are connecting to does not have an instance of the cluster queue you are targeting, you should leave the base queue manager name blank in the Queue Connection Factory Definition. Otherwise you will get an error, because MQ will look for an instance of that queue on the local queue manager, and since it is not there you will get a RC 2085 [MQRC_UNKNOWN_OBJECT_NAME].
I actually did not know that until I read this link!!! I just learned something new.
I am not sure whether this still applies for MQ 6 and WAS 6...???
I usually like to test things out myself, so you best believe when I have some time I will try out these scenarios on my local environment... |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Dec 12, 2007 3:39 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Depending on your local setup JMS has sometimes the tendency to add the qmgr you're connected to, to the destination, if the destination does not contain a qmgr.
The story about a remote queue (for the destination) is hogwash. What you may want to use is a CLUSTER ALIAS..
In you JMS destination you then put the cluster alias as base qmgr for the destination. MQ will resolve it to the cluster using the cluster alias....
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Dec 13, 2007 5:29 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Vitor,
In those JMS guys' queue object, they have a parm called QMANAGER. The manual says that this is "The name of the queue manager to connect to." This is WRONG:
http://www.mqseries.net/phpBB2/viewtopic.php?t=12350&highlight=
If they are connected to QM1 in a cluster, and TheQueue is hosted on QM2, QM3 and QM4, they have to leave that QMANAGER property blank. If not, they are telling MQ to look for TheQueue on QM1 which of course fails and makes them think they need a definition of the queue on QM1.
Leave QMANAGER blank and the JMS app connected to QM1 will be able to put to TheQueue hosted elsewhere in the cluster.
And if/when they want to go to a specific instance of TheQueue, then they can populate QMANAGER with QM2 or QM3 or whatever. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 14, 2007 2:04 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Thanks guys!
May good things happen to you all by the truckfull, and what god / gods / deities / astral beings / natural forces you believe in shower you with blessings.
I'm off to drown some Java people in a large vat of hogwash. Those who attempt to escape will be beaten back under with a military-grade trout.
Serious thanks people - I love this board!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Dec 14, 2007 7:51 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You may end up needing the cluster alias, though. And that would have to be specified in the QMANAGER.
This is in part because of the bad habit of JMS of opening a queue for Inquire, which you can't do against a non-local object...  _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 14, 2007 8:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jefflowrey wrote: |
This is in part because of the bad habit of JMS of opening a queue for Inquire, which you can't do against a non-local object...  |
So I drown the JMS standard as well - it's a big vat...... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Keka |
Posted: Fri Dec 14, 2007 8:38 am Post subject: |
|
|
Voyager
Joined: 28 Dec 2002 Posts: 96
|
Just to add to what everyody said,
You dont need any speacial alias definition..
I used Alias to the queue on the queue manger where it is defined and only kept the alias in the cluster to make it portable but that is not necessary.
All you need is to keep the queue manager name blank in the MQ destination definition or what ever queue destination you define in WAS.
As long as the queue is visible to you when you do the qcluster from the queue manager that your WAS is connecting to, you will be all set.
I have implemented this here very recently and is working fine in production. _________________ Keka |
|
Back to top |
|
 |
ling_71_99 |
Posted: Fri Dec 21, 2007 8:30 am Post subject: If java side is websphere MQ Link |
|
|
 Novice
Joined: 19 Nov 2007 Posts: 11 Location: Canada
|
Which version are you running for websphere?
Before websphere 6, all java application using MQ JMS client to connect to remote Queue Manager,
After 6.x, there are one more way to connect websphere to MQ: WebSphere MQ Link, which treat websphere message engine as Queue manager (need setup sender/receiver channel between QMs).
So my understanding is if the setting is second case, then nothing you need to do at your side.
My 2 cents. _________________ Mike |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 21, 2007 9:02 am Post subject: Re: If java side is websphere MQ Link |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
ling_71_99 wrote: |
Which version are you running for websphere?
Before websphere 6, all java application using MQ JMS client to connect to remote Queue Manager,
After 6.x, there are one more way to connect websphere to MQ: WebSphere MQ Link, which treat websphere message engine as Queue manager (need setup sender/receiver channel between QMs).
So my understanding is if the setting is second case, then nothing you need to do at your side.
My 2 cents. |
On the contrary. This makes the use of a cluster alias mandatory.
Sending a message from the SIBUS(outside of MQ Cluster) to the MQ cluster makes the usage of a cluster alias mandatory...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|