ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Message Locking.....Need Help

Post new topic  Reply to topic
 Message Locking.....Need Help « View previous topic :: View next topic » 
Author Message
elvis_gn
PostPosted: Thu Mar 10, 2005 5:34 am    Post subject: Message Locking.....Need Help Reply with quote

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
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Thu Mar 10, 2005 5:52 am    Post subject: Reply with quote

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
View user's profile Send private message
elvis_gn
PostPosted: Thu Mar 10, 2005 6:18 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Thu Mar 10, 2005 6:30 am    Post subject: Reply with quote

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
View user's profile Send private message
elvis_gn
PostPosted: Thu Mar 10, 2005 6:56 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Thu Mar 10, 2005 9:13 am    Post subject: Reply with quote

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
View user's profile Send private message
elvis_gn
PostPosted: Thu Mar 10, 2005 9:22 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Message Locking.....Need Help
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.