Author |
Message
|
jwatson |
Posted: Fri Nov 10, 2006 12:20 pm Post subject: Getting backout threshold with MQ Java API |
|
|
Newbie
Joined: 10 Nov 2006 Posts: 6
|
Maybe I'm just missing something here but I don't see how I am supposed to get the backout threshold for a queue using the MQ Java API.
I can easily enough get the backout count, but given that MQ does not handle backout requeuing (which makes no sense to me, but anyway) I need to know the backout threshold and the backout 're-queue' name.
There's a method called getAttributeString that I can see on the MQQueue class but I don't find any documentation for it in the MQ Java API documentation, at least not the verison I have.
Anyone know how you get this through the MQ Java API?
thanks. |
|
Back to top |
|
 |
malammik |
Posted: Fri Nov 10, 2006 1:36 pm Post subject: |
|
|
 Partisan
Joined: 27 Jan 2005 Posts: 397 Location: Philadelphia, PA
|
The simplest thing to do is to have queue naming convention so that if ur input queue is APPLES then backout is APPLES.BACKOUT or BACKOUT.APPLES however you would have to use pcf commands to retrieve backout queue name. The trheshold u might not need to know because you will get an exception 2363 when the the treshold reaches the limit. _________________ Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex |
|
Back to top |
|
 |
jwatson |
Posted: Fri Nov 10, 2006 1:43 pm Post subject: |
|
|
Newbie
Joined: 10 Nov 2006 Posts: 6
|
malammik wrote: |
The simplest thing to do is to have queue naming convention so that if ur input queue is APPLES then backout is APPLES.BACKOUT or BACKOUT.APPLES however you would have to use pcf commands to retrieve backout queue name. The trheshold u might not need to know because you will get an exception 2363 when the the treshold reaches the limit. |
No I don't get any exception at all. I can keep on getting the message well past the threshold. How would I move the message if the get threw an exception anyway?
I really don't care as much about the backout queue as I do about the threshold. I'm planning on putting the message into a db table. It seems easier for the purposes of tracking why the message was poisonous. I'll probably just use a backout queue as a fallback and/or to signal that there is a poison message that needs a human's attention.
I already have a dynamic configuration for my queue listeners. If there isn't a clean way to do this, someone please just say so, so I can go ahead and deal with it on my own. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Nov 10, 2006 2:00 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
The easy and clean way is to use WAS and MDB.
All you have to worry about is to set the BO threshold and set the backout queue.
Start the MDB with retry > bothresh ... Done....
But if oustside of that config, it is the applications' responsibility...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jwatson |
Posted: Fri Nov 10, 2006 2:04 pm Post subject: I'm new here, not stupid |
|
|
Newbie
Joined: 10 Nov 2006 Posts: 6
|
fjb_saper wrote: |
But if oustside of that config, it is the applications' responsibility...
|
I understand that it's my responsibility. How do I fufill it if I can't get the threshold? |
|
Back to top |
|
 |
wschutz |
Posted: Fri Nov 10, 2006 2:07 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Use the inquire() method of the MQManagedObject class (from which MQQueue is derived...) with MQIA_BACKOUT_THRESHOLD and MQCA_BACKOUT_REQ_Q_NAME selectors ..... _________________ -wayne |
|
Back to top |
|
 |
jwatson |
Posted: Fri Nov 10, 2006 2:18 pm Post subject: thanks |
|
|
Newbie
Joined: 10 Nov 2006 Posts: 6
|
wschutz wrote: |
Use the inquire() method of the MQManagedObject class (from which MQQueue is derived...) with MQIA_BACKOUT_THRESHOLD and MQCA_BACKOUT_REQ_Q_NAME selectors ..... |
Thanks. Where are these declared? I searched the Java API document and did not find them and they are not on MCQ or MQManagedObject. |
|
Back to top |
|
 |
wschutz |
Posted: Fri Nov 10, 2006 2:29 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
ummm..they are in MQC:
MQC.MQCA_BACKOUT_REQ_Q_NAME
MQC.MQIA_BACKOUT_THRESHOLD _________________ -wayne |
|
Back to top |
|
 |
jwatson |
Posted: Mon Nov 13, 2006 7:03 am Post subject: |
|
|
Newbie
Joined: 10 Nov 2006 Posts: 6
|
wschutz wrote: |
ummm..they are in MQC:
MQC.MQCA_BACKOUT_REQ_Q_NAME
MQC.MQIA_BACKOUT_THRESHOLD |
Not in the jar I have. I looked at the manifest and it's got this:
Implementation-Version: 5.306 - j5306-11-050725
I'm thinking that's pretty old but I'm stuck with what we have on our iSeries servers.
I'm going to take a shot at finding the literal values from the programming reference and see if I can still make an equivalent call.
...
Found them in the CMQC.h file:
MQIA_BACKOUT_THRESHOLD = 22;
MQCA_BACKOUT_REQ_Q_NAME = 2019; |
|
Back to top |
|
 |
malammik |
Posted: Mon Nov 13, 2006 7:21 am Post subject: |
|
|
 Partisan
Joined: 27 Jan 2005 Posts: 397 Location: Philadelphia, PA
|
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Nov 13, 2006 7:24 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
jwatson |
Posted: Mon Nov 13, 2006 11:17 am Post subject: |
|
|
Newbie
Joined: 10 Nov 2006 Posts: 6
|
Thanks to everyone who assisted with this. Here's a working snippet for as400 if anyone else needs it:
Code: |
int[] query = {MQIA_BACKOUT_THRESHOLD, MQCA_BACKOUT_REQ_Q_NAME};
int[] outi = new int[1];
byte[] outb = new byte[48];
queue.inquire(query, outi, outb);
String bq;
backoutThreshold = outi[0];
try {
bq = new String(outb, "ibm-0" + CCSID).trim();
} catch (UnsupportedEncodingException e) {
LOGGER.warn(e);
bq = null;
}
backoutQueue = bq; |
|
|
Back to top |
|
 |
|