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 » Checking for Messages in Queue

Post new topic  Reply to topic
 Checking for Messages in Queue « View previous topic :: View next topic » 
Author Message
rbharatha
PostPosted: Sun Oct 19, 2003 11:28 pm    Post subject: Checking for Messages in Queue Reply with quote

Newbie

Joined: 18 Oct 2003
Posts: 5

Dim mqMsg As New MQMessage ' MQMessage instance
Dim mqGetMsgOpts As New MQGetMessageOptions ' MQGetMessageOptions
'
oMqQueue.Get(mqMsg, mqGetMsgOpts)
'
I want to check for Messages in the Queue, before getting the Messages from the Queue. How can i do that.

I am client and Server connection type.
_________________
Ramesh Bharata
Back to top
View user's profile Send private message
mqonnet
PostPosted: Mon Oct 20, 2003 5:18 am    Post subject: Reply with quote

Grand Master

Joined: 18 Feb 2002
Posts: 1114
Location: Boston, Ma, Usa.

In your open options add MQOO_BROWSE and in your get options add MQGMO_BROWSE_NEXT. This way you would be able to browse a message first before destructively getting it.

Cheers
Kumar
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rbharatha
PostPosted: Mon Oct 20, 2003 5:34 am    Post subject: Checking for Messages in Queue - "Before Reading it&quo Reply with quote

Newbie

Joined: 18 Oct 2003
Posts: 5

Hi Kumar:

It can be one option, but browse to next message in the Queue, It would generate an exception saying the completion code:2033.

I want over come this and check before it prompts me an execption.

can anybody look into this.
_________________
Ramesh Bharata
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 20, 2003 5:39 am    Post subject: Re: Checking for Messages in Queue - "Before Reading it Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

rbharatha wrote:
It can be one option, but browse to next message in the Queue, It would generate an exception saying the completion code:2033.

2033 is a reason code, not a completion code. It means "no more messages on the queue". Which means you've browsed past the last message.
rbharatha wrote:

I want over come this and check before it prompts me an execption.
This should be as simple as changing your code to check for the error condition, and not throwing an exception.

Quote:
can anybody look into this.

There are several manuals available from IBM that will allow you to figure a lot of stuff out yourself, instead of waiting for someone here to answer your question. Just click on the button marked 'Documentation' at the top of the screen.

I recommend reading the Application Programming Guide, and the Using the Component Object Model Interface manual since you appear to be working with VB.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
packetOfFudge
PostPosted: Mon Oct 20, 2003 6:12 am    Post subject: Reply with quote

Newbie

Joined: 20 Oct 2003
Posts: 1

Surely asking a question on a forum is the whole idea Jeff!
Back to top
View user's profile Send private message
mqonnet
PostPosted: Mon Oct 20, 2003 6:28 am    Post subject: Reply with quote

Grand Master

Joined: 18 Feb 2002
Posts: 1114
Location: Boston, Ma, Usa.

packetOfFudge, You have to remember that NOBODY here is DOING a FREE CONSULTING. A Forum is meant to assist people in a specific area or topic to resolve the doubts they have. It is not meant to provide Solutions. You have solution providers for that.

The reason Jeff and anyone who posts here points to the docs because most of the stuff is in the docs. Some people are not aware of it and hence pointed to, others just dont want to read the manuals. :). That again doesnt mean that people do not go out of their ways to post solutions, which is always welcome you see.

Saying so, does not mean that you should not post a question that pops into your mind. A person who posts a very silly question, might be silly for an experienced professional but a hard one for a novice. Hence you have to try and assist everyone accordingly only.

Cheers
Kumar
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Checking for Messages in Queue
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.