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 » Getting backout threshold with MQ Java API

Post new topic  Reply to topic
 Getting backout threshold with MQ Java API « View previous topic :: View next topic » 
Author Message
jwatson
PostPosted: Fri Nov 10, 2006 12:20 pm    Post subject: Getting backout threshold with MQ Java API Reply with quote

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
View user's profile Send private message
malammik
PostPosted: Fri Nov 10, 2006 1:36 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
jwatson
PostPosted: Fri Nov 10, 2006 1:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Nov 10, 2006 2:00 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jwatson
PostPosted: Fri Nov 10, 2006 2:04 pm    Post subject: I'm new here, not stupid Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Fri Nov 10, 2006 2:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
jwatson
PostPosted: Fri Nov 10, 2006 2:18 pm    Post subject: thanks Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Fri Nov 10, 2006 2:29 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
jwatson
PostPosted: Mon Nov 13, 2006 7:03 am    Post subject: Reply with quote

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
View user's profile Send private message
malammik
PostPosted: Mon Nov 13, 2006 7:21 am    Post subject: Reply with quote

Partisan

Joined: 27 Jan 2005
Posts: 397
Location: Philadelphia, PA

There is also a redbook called WebSphere MQ Constants SC34-6607-00, where all constants' values can be found.
_________________
Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex
Back to top
View user's profile Send private message Visit poster's website AIM Address
jefflowrey
PostPosted: Mon Nov 13, 2006 7:24 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

malammik wrote:
There is also a redbook called WebSphere MQ Constants SC34-6607-00, where all constants' values can be found.


That's a manual, not a Red Book.

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaq.doc/csqzaq00.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jwatson
PostPosted: Mon Nov 13, 2006 11:17 am    Post subject: Reply with quote

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
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 » Getting backout threshold with MQ Java API
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.