Author |
Message
|
magesh_chandren |
Posted: Sun Oct 17, 2004 9:33 pm Post subject: MQGMO_WAIT with 0 seconds of wait interval is not working |
|
|
Novice
Joined: 16 Feb 2004 Posts: 12
|
Hi,
Using java MQ api is put and get messages on queues. It was working fine so far until I tried to manipulate with the wait interval.
I used to wait for messages with a particual correlation ID
(ie gmo.matchOptions = MQC.MQMO_MATCH_CORREL_ID;)
and with MQGMO_WAIT option on with a wait of 2 mins
(ie gmo.options = MQC.MQGMO_WAIT;
gmo.waitInterval = 120000;
)
Now Iam doing a manual performance check, like varying the wait intrval and see how long it takes to get the response. When I specified a waitInterval of 0 milliseconds, I wanted it to fail with no message on queue. However, it retrieved me the message from the queue ... Can anyone tell me how to resolve this ?
Thanks |
|
Back to top |
|
 |
kirani |
Posted: Sun Oct 17, 2004 10:22 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
WaitInterval option is used only when the message is not found on the queue. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
zpat |
Posted: Sun Oct 17, 2004 11:34 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Since the wait ends as soon as a message is available to meet the MQGET criteria - the value of the wait interval should not affect performance. |
|
Back to top |
|
 |
magesh_chandren |
Posted: Mon Oct 18, 2004 2:45 am Post subject: |
|
|
Novice
Joined: 16 Feb 2004 Posts: 12
|
I agree with what you say..... the performance what I was referring to was my backend prog performance. Sorry for not giving the whole picture.
In my application, I put a message A on to a queue say REQUESTQ. My Backend program receives this message and does some operation(it takes a time say x mins) and puts back a message B onto the queue.
So there is always a sufficient delay by the time I put the message and get the message. Hence, I expected a 2033 error when I give a wait of 0 secs.
Am I missing anything here ? Pls advice! |
|
Back to top |
|
 |
kirani |
Posted: Mon Oct 18, 2004 2:08 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
How many messages did you have on the queue when you issued MQGET call for getting response message with 0 waitinterval. Can you try the same code without specifying MQGMO_WAIT option and see what happens? _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
Manikandan |
Posted: Wed Oct 20, 2004 8:53 pm Post subject: |
|
|
Voyager
Joined: 07 Jul 2004 Posts: 78
|
wait interval option works like
wait until the message arrives on the queue.
If the message is already present in the queue is picks them immediately.
if you have an wait interval of 20000 i.e. 20 secs and then the message arrives at 10 secs it picks up and returns.
it does not mean it will wait all 20 secs,it will wait until the match message arrives. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Oct 21, 2004 1:53 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Doesn't a 0 wait interval mean in fact wait forever ?
Seems if you don't want to wait you need to do a get with nowait option or a JMS receiveNoWait() (From memory)
Enjoy  |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Oct 21, 2004 2:09 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
fjb_saper wrote: |
Doesn't a 0 wait interval mean in fact wait forever ? |
No. The value of "-1" is the same as the constant for "Wait Unlimited". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|