Author |
Message
|
sc |
Posted: Wed Mar 17, 2004 2:30 pm Post subject: Restrict number of input/output process on local queue |
|
|
Novice
Joined: 06 Sep 2003 Posts: 16
|
We like to restrict the number of process which open a local queue to do input/output. The reason is that we like to dequeue and process the messages in the strict order, one finished, then anthoer. And if someone accidently started another dequeue process, that could mess up the message order.
Can we config some parameters to do that?
Or is there better way?
Thanks. |
|
Back to top |
|
 |
EddieA |
Posted: Wed Mar 17, 2004 2:55 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
No, but you can use MQOO_OPEN_EXCLUSIVE. Or set DEFSOPT(EXCL) on the Queue and hope nobody overrides it programmatically.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
Michael Dag |
Posted: Wed Mar 17, 2004 3:03 pm Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
Sorry to butt in...
The first thing you need to get between the ears when using messaging is to get rid of message affinity (i.e. order of message processing dependency)! _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Mar 17, 2004 5:28 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Eddie, if you set the queue attribute, the programmer will not be able to overide it.
Quote: |
This indicates whether the queue can be opened for input multiple times concurrently. The value is one of the following:
MQQA_SHAREABLE
Queue is shareable.
Multiple opens with the MQOO_INPUT_SHARED option are allowed.
MQQA_NOT_SHAREABLE
Queue is not shareable.
An MQOPEN call with the MQOO_INPUT_SHARED option is treated as MQOO_INPUT_EXCLUSIVE.
|
_________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
kman |
Posted: Thu Mar 18, 2004 12:17 am Post subject: |
|
|
Partisan
Joined: 21 Jan 2003 Posts: 309 Location: Kuala Lumpur, Malaysia
|
If you open exclusive, isn't that the same as having just one instance of the application for the queue? Or one appp per queue?
And if message affinity is so important, you can't have more than an instance of the applicaiton serving the queue anyway.. because that would 'mess up' the order.  |
|
Back to top |
|
 |
gunter |
Posted: Thu Mar 18, 2004 12:28 am Post subject: |
|
|
Partisan
Joined: 21 Jan 2004 Posts: 307 Location: Germany, Frankfurt
|
When the process ends and the queue is opened excliusive, close the queue in any circumstance, otherwise you have to wait until qmgr has freed the handle. _________________ Gunter Jeschawitz
IBM Certified System Administrator - Websphere MQ, 5.3 |
|
Back to top |
|
 |
EddieA |
Posted: Thu Mar 18, 2004 7:52 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Oooops.
That's the problem every time I see an option that includes 'AS_Q_DEF', I assume that it can be overridden.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Mar 18, 2004 7:56 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
There are actually 2 parameters of the queue that relate here:
Quote: |
DefInputOpenOption (MQLONG)
Default input open option.
Local Model Alias Remote Cluster
Yes Yes No No No
This is the default way in which the queue should be opened for input. It applies if the MQOO_INPUT_AS_Q_DEF option is specified on the MQOPEN call when the queue is opened. The value is one of the following:
MQOO_INPUT_EXCLUSIVE
Open queue to get messages with exclusive access.
The queue is opened for use with subsequent MQGET calls. The call fails with reason code MQRC_OBJECT_IN_USE if the queue is currently open by this or another application for input of any type (MQOO_INPUT_SHARED or MQOO_INPUT_EXCLUSIVE).
MQOO_INPUT_SHARED
Open queue to get messages with shared access.
The queue is opened for use with subsequent MQGET calls. The call can succeed if the queue is currently open by this or another application with MQOO_INPUT_SHARED, but fails with reason code MQRC_OBJECT_IN_USE if the queue is currently open with MQOO_INPUT_EXCLUSIVE.
|
Quote: |
Shareability (MQLONG)
Whether queue can be shared for input.
Local Model Alias Remote Cluster
Yes Yes No No No
This indicates whether the queue can be opened for input multiple times concurrently. The value is one of the following:
MQQA_SHAREABLE
Queue is shareable.
Multiple opens with the MQOO_INPUT_SHARED option are allowed.
MQQA_NOT_SHAREABLE
Queue is not shareable.
An MQOPEN call with the MQOO_INPUT_SHARED option is treated as MQOO_INPUT_EXCLUSIVE.
To determine the value of this attribute, use the MQIA_SHAREABILITY selector with the MQINQ call.
|
In the original posters scenario, the MQAdmin can control things by setting Shareability. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
|