Author |
Message
|
issac |
Posted: Thu Oct 02, 2008 1:22 am Post subject: how does amqsput distinguish qlocal and qcluster? |
|
|
 Disciple
Joined: 02 Oct 2008 Posts: 158 Location: Shanghai
|
hi, guys
i'm following a tutorial in redbook: csqzah07.pdf <<Queue Manager Clusters>>. I created two queue managers on the same machine, joint them into into a cluster with both as full repository.
QMGR1: LONDON, repository INVENTORY
QLOCAL: INVENTQ, cluster INVENTORY
QMGR2: NEWYORK, repository INVENTORY
QLOCAL: INVENTQ, cluster INVENTORY
I've set up channels of CLUSRCVR, CLUSSDR on both queue managers and ensured they're running.
when i
Code: |
amqsput INVENTQ LONDON |
i input 4 messages, and expect to find msgs distributed in a round-robin pattern. that is LONDON's INVENTQ has 2 and NEWYORK's INVENTQ has 2
however all i input goes directly to LONDON's INVENTQ.
Quote: |
DIS QLOCAL(INVENTQ) CURDEPTH
4 : DIS QLOCAL(INVENTQ) CURDEPTH
AMQ8409: 显示队列细节。
QUEUE(INVENTQ) TYPE(QLOCAL)
CURDEPTH(4)
|
and SYSTEM.CLUSTER.TRANSMIT.QUEUE has nothing inside:
Quote: |
DIS QLOCAL(SYSTEM.CLUSTER.TRANSMIT.QUEUE) CURDEPTH
2 : DIS QLOCAL(SYSTEM.CLUSTER.TRANSMIT.QUEUE) CURDEPTH
AMQ8409: 显示队列细节。
QUEUE(SYSTEM.CLUSTER.TRANSMIT.QUEUE) TYPE(QLOCAL)
CURDEPTH(0)
|
but INVENTQ is indeed name of a cluster queue as well as a local queue. so how could amqsput distinguish between them?
------------------------------
PS>I've ensured the cluster is setup correctly in the following way:
Quote: |
DISPLAY CLUSQMGR(*)
7 : DISPLAY CLUSQMGR(*)
AMQ8441: 显示集群队列管理器详细信息。
CLUSQMGR(LONDON) CHANNEL(TO.LONDON)
CLUSTER(INVENTORY)
AMQ8441: 显示集群队列管理器详细信息。
CLUSQMGR(NEWYORK) CHANNEL(TO.NEWYORK)
CLUSTER(INVENTORY)
DISPLAY QCLUSTER(*) ALL
9 : DISPLAY QCLUSTER(*) ALL
AMQ8409: 显示队列细节。
QUEUE(INVENTQ) TYPE(QCLUSTER)
ALTDATE(2008-10-01) ALTTIME(16.23.24)
CLUSDATE(2008-09-29) CLUSTER(INVENTORY)
CLUSQMGR(LONDON) CLUSQT(QLOCAL)
CLUSTIME(20.51.31) CLWLPRTY(0)
CLWLRANK(0) DEFBIND(OPEN)
DEFPRTY(0) DEFPSIST(NO)
DEFPRESP(SYNC) DESCR( )
PUT(ENABLED) QMID(LONDON_2008-09-29_20.35.51)
AMQ8409: 显示队列细节。
QUEUE(INVENTQ) TYPE(QCLUSTER)
ALTDATE(2008-09-29) ALTTIME(20.51.20)
CLUSDATE(2008-09-29) CLUSTER(INVENTORY)
CLUSQMGR(NEWYORK) CLUSQT(QLOCAL)
CLUSTIME(20.51.20) CLWLPRTY(0)
CLWLRANK(0) DEFBIND(OPEN)
DEFPRTY(0) DEFPSIST(NO)
DEFPRESP(SYNC) DESCR( )
PUT(ENABLED) QMID(NEWYORK_2008-09-29_20.25.3
|
i searched through entries and found this works:
Code: |
amqsput INVENTQ LONDON 16 0 NEWYORK |
but it puts everything into NEWYORK's INVENTQ, not in a round-robin way as i expect.
i'm still a newbie to mq, and got kinda stuck here. i'm still flipping through redbooks for an answer. someone please help. thanks!
[/quote] |
|
Back to top |
|
 |
Mr Butcher |
Posted: Thu Oct 02, 2008 1:32 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
What MQ Version are you using?
By default, if there is a local queue, it is always selected instead of the cluster queues.
Check with the Queue Manager Clusters manual page 51 (see the note a t the button of the page ... and read on the next pages (53, workload algorithm).... _________________ Regards, Butcher |
|
Back to top |
|
 |
ranganathan |
Posted: Thu Oct 02, 2008 8:55 pm Post subject: |
|
|
 Centurion
Joined: 03 Jul 2008 Posts: 104
|
It has to do with the Workload balancing algorithm.. check the qmgr attribute CLWLUSEQ .. if it is set to LOCAL then the target would always be the local instance of the queue. you can try CLWLUSEQ (ANY) and also check the other queue workload attributes like CLWLUSEQ, CLWLPRTY, CLWLRANK etc..
Quote: |
CLWLUSEQ queue manager attribute
This queue manager attribute specifies the behavior of an MQPUT operation when the target queue has a local instance and at least one remote cluster instance (except where the MQPUT originates from a cluster channel), for queues whose CLWLUSEQ parameter has a value of QMGR. If you specify LOCAL, the local queue is the only target for MQPUTs. This is the queue manager's initial default value. If you specify ANY, the queue manager treats the local queue as another instance of the cluster queue for the purposes of workload distribution.
This attribute allows WebSphere MQ to put messages on to remotely defined queues as well as local queue instances. In this case, 'remote' means other queue managers within the cluster which also have a definition of the cluster queue. If remote instances of cluster queues can be used, there is a need to prevent WebSphere MQ from repeatedly choosing a remote instance of a cluster queue. To ensure this, WebSphere MQ applies the following rules to restrict the number of remote hops to one:
* If a message arrives over a cluster channel, it must be put to a local instance of a cluster queue.
* If put locally or over a non-cluster channel, messages can be put to a local or remote cluster queue instance.
|
Last edited by ranganathan on Thu Oct 02, 2008 11:28 pm; edited 1 time in total |
|
Back to top |
|
 |
zboy |
Posted: Thu Oct 02, 2008 10:37 pm Post subject: |
|
|
Novice
Joined: 01 Oct 2008 Posts: 13
|
The iniital value of the DEFBIND attribute on a queue is OPEN, and amqsput does not alter it when opening the queue, so msgs will all go to a single instance of the cluster queue. |
|
Back to top |
|
 |
issac |
Posted: Fri Oct 03, 2008 12:17 am Post subject: |
|
|
 Disciple
Joined: 02 Oct 2008 Posts: 158 Location: Shanghai
|
thanks very much for all of ur replies.
My MQ version is Websphere MQ V7.0.0.0 Trial.
i've testified that if it's the first time i amqsput anything into LONDON, it all goes to LONDON's qlocal. However if I amqsput again my msg would goto NEWYORK.
i suppose this post might explain the reason:
Quote: |
The initial value of the DEFBIND attribute on a queue is OPEN, and amqsput does not alter it when opening the queue, so msgs will all go to a single instance of the cluster queue. |
since all my cluster member's load-balancing algorithm is set to LOCAL, once the QMGR LONDON is instructed to put msgs into cluster queue INVENTQ, it chooses its local queue in the first place.
So I think this question has been answered.  |
|
Back to top |
|
 |
sami.stormrage |
Posted: Fri Oct 03, 2008 12:31 am Post subject: my question |
|
|
 Disciple
Joined: 25 Jun 2008 Posts: 186 Location: Bangalore/Singapore
|
What about messages round robining even when the bind is changed from 'Notfixed' to 'Open'? on local machine
Could it because MQ workload distribution depends on the name resolution that happens (threads) from a distributed system and not a local one?
[/quote] _________________ *forgetting everything * |
|
Back to top |
|
 |
exerk |
Posted: Fri Oct 03, 2008 1:25 am Post subject: Re: my question |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
sami.stormrage wrote: |
What about messages round robining even when the bind is changed from 'Notfixed' to 'Open'? on local machine... |
With only two queue managers in the cluster there is going to be very little in the way of load balancing, unless the CLWLUSEQ attributes are set.
issac - create another two queue managers and put them in the cluster, then define a queue instance in each (shared in the cluster) with BIND(NOTFIXED), put messages to the queue from LONDON and NEWYORK; this will better demonstrate 'round robin'. _________________ 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 |
|
 |
issac |
Posted: Sat Oct 04, 2008 1:10 am Post subject: Re: my question |
|
|
 Disciple
Joined: 02 Oct 2008 Posts: 158 Location: Shanghai
|
exerk wrote: |
issac - create another two queue managers and put them in the cluster, then define a queue instance in each (shared in the cluster) with BIND(NOTFIXED), put messages to the queue from LONDON and NEWYORK; this will better demonstrate 'round robin'. |
Mmmm... but what does BIND(NOTFIXED) mean ? this might sound really stupid. I tried to create the following way but it's not right:
define qlocal(QTEST001) BIND(NOTFIXED) CLUSTER(INVENTORY)
or
define qlocal(QTEST001) BIND(NOTFIXED)
BIND does not look like a qlocal property, or is it already removed in MQ V7.0.0.0.0? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Oct 04, 2008 7:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
@issac
Bind not fixed has only meaning in a clustered environment where there is more than one instance of the queue. If you hold the only instance of a queue, bind on open or bind not fixed makes no difference.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
PeterPotkay |
Posted: Sat Oct 04, 2008 12:17 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
fjb_saper wrote: |
If you hold the only instance of a queue, bind on open or bind not fixed makes no difference. |
Your bind options also become irrelevant if you specify the destination QM name in the MQOPEN or MQPUT1 call. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
bruce2359 |
Posted: Sat Oct 04, 2008 2:00 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
The bind option at mqopen has three possible values:
MQOO_BIND_ON_OPEN
MQOO_BIND_NOT_FIXED
MQOO_BIND_AS_Q_DEF
If the application specifies the third option, then the setting at the queue takes effect.
As stated earlier, the bind option only applies to clustered queues.
Refer to the WMQ Application Programming Ref. _________________ 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 |
|
 |
ranganathan |
Posted: Sat Oct 04, 2008 8:49 pm Post subject: Re: my question |
|
|
 Centurion
Joined: 03 Jul 2008 Posts: 104
|
issac wrote: |
BIND does not look like a qlocal property, or is it already removed in MQ V7.0.0.0.0? |
Is this attribute removed in MQ v 7 ??....  |
|
Back to top |
|
 |
bruce2359 |
Posted: Sun Oct 05, 2008 5:49 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Did you search the WMQ Script Command Reference manual? Did you look at the DEFINE QLOCAL command? Did you search for 'BIND'? What did the manual say about BIND?
Did you search the WMQ Application Programming Reference manual? Did you look at the MQOPEN call? Did you search for 'BIND'?
Please do a little research on your own before posting. _________________ 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 |
|
 |
|