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 Java / JMS » Methods to read Queue backout threshold and requeue name ?

Post new topic  Reply to topic
 Methods to read Queue backout threshold and requeue name ? « View previous topic :: View next topic » 
Author Message
AlexeiSkate
PostPosted: Mon May 27, 2002 2:14 pm    Post subject: Methods to read Queue backout threshold and requeue name ? Reply with quote

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
View user's profile Send private message
kolban
PostPosted: Mon May 27, 2002 6:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Tue May 28, 2002 7:38 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
techno
PostPosted: Mon Jan 26, 2004 4:40 pm    Post subject: Reply with quote

Chevalier

Joined: 22 Jan 2003
Posts: 429

Do we have corresponding API in JMS. Pls help. Thanks.
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue Jan 27, 2004 6:47 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
techno
PostPosted: Tue Jan 27, 2004 11:49 am    Post subject: Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Tue Jan 27, 2004 2:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
techno
PostPosted: Tue Jan 27, 2004 3:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
fschofer
PostPosted: Wed Jan 28, 2004 1:39 am    Post subject: Reply with quote

Knight

Joined: 02 Jul 2001
Posts: 524
Location: Mainz, Germany

Support Pack MS0B: WebSphere MQ Java classes for PCF

http://www-306.ibm.com/software/integration/support/supportpacs/individual/ms0b.html
Back to top
View user's profile Send private message Send e-mail
techno
PostPosted: Wed Jan 28, 2004 8:49 am    Post subject: Reply with quote

Chevalier

Joined: 22 Jan 2003
Posts: 429

Thank you. I got them.
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 Java / JMS » Methods to read Queue backout threshold and requeue name ?
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.