Author |
Message
|
elvis_gn |
Posted: Thu Mar 10, 2005 5:34 am Post subject: Message Locking.....Need Help |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi,
I'm trying to lock messages while doing a browse in a queue.It is working successfully as the message is temporarly removed from the queue and is not visible in the queue.....
The problem is that the queue depth remains the same even though the number of messages for browse now are reduced by one.
when another application tries to get(browse) the messages i do a getCurrentDepth and so, on the last message the .get() fails because now a message is not available on the last position.
P.S - the locked message did not give any problems.....
Can i check if the next message is available on a queue before doing a get ???
OR Can i find the depth of only unlocked messages ????? |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 10, 2005 5:52 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can't rely on queue depth, and your applications should not be using it to tell when the queue is empty.
Applications should always get until they get a 2033 - no more messages. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Mar 10, 2005 6:18 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Can u tell me if i need to catch this as an exception ????
Will it cause my application to crash ???? |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 10, 2005 6:30 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
2033 is the WebSphere MQ Return Code from the Get call that indicates that no more messages are on the queue.
All of the IBM sample program uses this to check that the queue is empty - well, except possibly the JMS samples...
So go look at any IBM sample program for whatever language you are using, and see how it is done.
Have you considered getting training on WebSphere MQ Development? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Mar 10, 2005 6:56 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
I will possibly think about that after this project i'm into.
But for info sake, i've done mq training,MQSI 5.0 training and now am working on MQWF.
Anyway thx,i knew the reason code etc,just wanted to know how to, not display to the user that this reason code is occuring everytime....
I think i have managed that too now thx for confirming that the reason code is a must and there is no other way out. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 10, 2005 9:13 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
elvis_gn wrote: |
thx for confirming that the reason code is a must and there is no other way out. |
That should have been covered in your MQ training. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Mar 10, 2005 9:22 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Its a self help kind of a training........
Most of the stuff i pick up during the projects.
By asking such dumb questions for example  |
|
Back to top |
|
 |
|