| Author | 
		  Message
		 | 
		
		  | crayon_coco | 
		  
		    
			  
				 Posted: Mon Mar 01, 2004 12:43 am    Post subject: check message availabilty before get | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 08 Oct 2003 Posts: 33
  
  | 
		  
		    
			  
				| can i check whether a message availability from the queue before getting it? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Galichet | 
		  
		    
			  
				 Posted: Mon Mar 01, 2004 3:21 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | crossland | 
		  
		    
			  
				 Posted: Mon Mar 01, 2004 4:24 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Master
 
 Joined: 26 Jun 2001 Posts: 248
  
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | vmcgloin | 
		  
		    
			  
				 Posted: Mon Mar 01, 2004 5:06 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | chaian | 
		  
		    
			  
				 Posted: Mon Mar 01, 2004 9:16 am    Post subject: availability vs exception | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 30 Sep 2003 Posts: 14 Location: Italy 
  | 
		  
		    
			  
				| The problem is about managing exceptions thrown by NO_MSG_AVAILABLE error?? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | clindsey | 
		  
		    
			  
				 Posted: Mon Mar 01, 2004 10:12 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |