| Author | 
		  Message
		 | 
		
		  | AlexeiSkate | 
		  
		    
			  
				 Posted: Mon May 27, 2002 2:14 pm    Post subject: Methods to read Queue backout threshold and requeue name ? | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 10 Apr 2002 Posts: 123
  
  | 
		  
		    
			  
				Hi,
 
 
I can't seem to find any method for the MQQueue class in the MQSeries for Java redbook that return to me the Backout threshold count and Backout Requeue Name defined for a queue. 
 
 
Right now I have those two values hard-coded in my Java program but I would rather be able to have the Queue object returned them to me if possible.  Do those getter methods exist in Java API ? 
 
 
Thanks,
 
Alex | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kolban | 
		  
		    
			  
				 Posted: Mon May 27, 2002 6:43 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA 
  | 
		  
		    
			  
				The MQQueue object is derived from the MQManagedObject class.  This class has an inquire() method which can be used to query the attributes of objects such as a queue.
 
 
Reviewing the MQSeries application programming reference on the MQINQ API call... I find MQCA_BACKOUT_REQ_Q_NAME and MQCA_BACKOUT_THRESHOLD as the attributes on the queue for which you wish the values inside your Java based application. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bower5932 | 
		  
		    
			  
				 Posted: Tue May 28, 2002 7:38 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA 
  | 
		  
		    
			  
				Here's a code fragment:
 
 
import com.ibm.mq.*;            // Include the MQ package
 
import com.ibm.mq.pcf.*;        // Include the MQ PCF package
 
 
......
 
 
  private String myQmgr = "";
 
  private String myQname;
 
  private MQQueueManager qMgr;
 
 
  private int[]  selectors = {
 
                     CMQC.MQIA_BACKOUT_THRESHOLD,
 
                     CMQC.MQCA_BACKOUT_REQ_Q_NAME };
 
  private int[]  intAttrs = new int[1];
 
  private byte[] charAttrs = new byte[MQC.MQ_Q_NAME_LENGTH];
 
 
  private int    boThresh;
 
 
.....
 
 
 int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE 
 
                        | MQC.MQOO_SAVE_ALL_CONTEXT;
 
      MQQueue myQueue = qMgr.accessQueue(myQname, openOptions, null, null, null);
 
 
      /***********************************************/
 
      /* Get the values for the queue and threshold. */
 
      /***********************************************/
 
      MQManagedObject moMyQueue = (MQManagedObject)myQueue;
 
      moMyQueue.inquire(selectors, intAttrs, charAttrs);
 
      boThresh = intAttrs[0];
 
      String myPutQname = new String(charAttrs);
 
      System.out.println("Backout Threshold: " + boThresh);
 
      System.out.println("Backout Queue: " + myPutQname);
 
 
Hope this helps.
 
 
Ron | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | techno | 
		  
		    
			  
				 Posted: Mon Jan 26, 2004 4:40 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Chevalier
 
 Joined: 22 Jan 2003 Posts: 429
  
  | 
		  
		    
			  
				| Do we have corresponding API in JMS. Pls help. Thanks. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bower5932 | 
		  
		    
			  
				 Posted: Tue Jan 27, 2004 6:47 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA 
  | 
		  
		    
			  
				| You can try looking a the Message.getJMSRedelivered() to see if a message has been redelivered.  You can also look at the JMSXDeliveryCount to see how many times it has been redelivered.  However, I know of nothing from JMS that will allow you to look at the underlying queue to get its backout threshold and queue name. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | techno | 
		  
		    
			  
				 Posted: Tue Jan 27, 2004 11:49 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Chevalier
 
 Joined: 22 Jan 2003 Posts: 429
  
  | 
		  
		    
			  
				I tried doing Base classes. MQIA_BACKOUT_THRESHOLD does not seem to be under MQC. 
 
MQC.MQIA_BACKOUT_THRESHOLD is not resolved. Where does this constant exist? Pls help. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bower5932 | 
		  
		    
			  
				 Posted: Tue Jan 27, 2004 2:51 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA 
  | 
		  
		    
			  
				It worked for me.  Make sure you have the import:
 
 
import com.ibm.mq.pcf.*;
 
 
and I used CMQC.MQIA_BACKOUT_THRESHOLD. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | techno | 
		  
		    
			  
				 Posted: Tue Jan 27, 2004 3:56 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Chevalier
 
 Joined: 22 Jan 2003 Posts: 429
  
  | 
		  
		    
			  
				com.ibm.mq.pcf.*
 
 
Where do I find them? I do not see in a 5.3 java jars.
 
 
Thanks | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fschofer | 
		  
		    
			  
				 Posted: Wed Jan 28, 2004 1:39 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Knight
 
 Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | techno | 
		  
		    
			  
				 Posted: Wed Jan 28, 2004 8:49 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Chevalier
 
 Joined: 22 Jan 2003 Posts: 429
  
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |