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 » check message availabilty before get

Post new topic  Reply to topic
 check message availabilty before get « View previous topic :: View next topic » 
Author Message
crayon_coco
PostPosted: Mon Mar 01, 2004 12:43 am    Post subject: check message availabilty before get Reply with quote

Apprentice

Joined: 08 Oct 2003
Posts: 33

can i check whether a message availability from the queue before getting it?
Back to top
View user's profile Send private message
Galichet
PostPosted: Mon Mar 01, 2004 3:21 am    Post subject: Reply with quote

Acolyte

Joined: 26 Jun 2001
Posts: 69
Location: Paris - France

Hi,

No you cannot do that ...

Two possibilities :
1) You have sent a request and you are waiting for the reply, then you can use wait interval option when getting your message.
2) A message is sent by someone, then you can use trigger. The message will be processed when it arrives in the Queue.

Eric.
_________________
Eric Galichet
SMABTP
France
Back to top
View user's profile Send private message Send e-mail
crossland
PostPosted: Mon Mar 01, 2004 4:24 am    Post subject: Reply with quote

Master

Joined: 26 Jun 2001
Posts: 248

You can use MQINQ to look at the number of messages on the queue.

Regards,

Tim Crossland
http://www.solent-consultancy.com
Back to top
View user's profile Send private message
vmcgloin
PostPosted: Mon Mar 01, 2004 5:06 am    Post subject: Reply with quote

Knight

Joined: 04 Apr 2002
Posts: 560
Location: Scotland

Or you could do a non-destructive GET (with BROWSE) depending on what you want to achieve.
Back to top
View user's profile Send private message
chaian
PostPosted: Mon Mar 01, 2004 9:16 am    Post subject: availability vs exception Reply with quote

Novice

Joined: 30 Sep 2003
Posts: 14
Location: Italy

The problem is about managing exceptions thrown by NO_MSG_AVAILABLE error??
Back to top
View user's profile Send private message MSN Messenger
clindsey
PostPosted: Mon Mar 01, 2004 10:12 am    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

You can ignore the message by catching it and doing nothing ....

Code:

catch (MQException ex)
{
   if (ex.reasonCode == MQException.MQRC_NO_MSG_AVAILABLE) { }
   else
   {
       System.out.println("MQ error: Completion code " +
                     ex.completionCode + " Reason code " + ex.reasonCode);
   }



Also put this line in one of you init methods to prevent MQ from reporting the 2033.

Code:

MQEnvironment.disableTracing ();
MQException.log = null;


Charlie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » check message availabilty before get
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.