Author |
Message
|
HenriqueS |
Posted: Thu Jan 28, 2010 8:59 am Post subject: Lookup MQ constants (integer to String) in WMQ 6.0 |
|
|
 Master
Joined: 22 Sep 2006 Posts: 235
|
Hello,
WMQ 7.0 offers an MQConstants.lookup() method that converts ints obtained from MQ constants (reason codes, compcodes, etc.) to a readable string.
Is there any code snippet about doing this with WMQ java libraries?
Many thanks, |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jan 28, 2010 9:07 am Post subject: Re: Lookup MQ constants (integer to String) in WMQ 6.0 |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
HenriqueS wrote: |
Hello,
WMQ 7.0 offers an MQConstants.lookup() method that converts ints obtained from MQ constants (reason codes, compcodes, etc.) to a readable string.
Is there any code snippet about doing this with WMQ java libraries?
Many thanks, |
Have you checked the MQSC and JMSC classes?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
HenriqueS |
Posted: Thu Jan 28, 2010 11:04 am Post subject: Re: Lookup MQ constants (integer to String) in WMQ 6.0 |
|
|
 Master
Joined: 22 Sep 2006 Posts: 235
|
AFAIK there is only the class 'MQC' bundled with WMQ 6.0. The constants are there but there is no easy way to look up them in runtime, only if I build a custom utility class doing reflection.
fjb_saper wrote: |
HenriqueS wrote: |
Hello,
WMQ 7.0 offers an MQConstants.lookup() method that converts ints obtained from MQ constants (reason codes, compcodes, etc.) to a readable string.
Is there any code snippet about doing this with WMQ java libraries?
Many thanks, |
Have you checked the MQSC and JMSC classes?  |
|
|
Back to top |
|
 |
HenriqueS |
Posted: Thu Jan 28, 2010 12:46 pm Post subject: |
|
|
 Master
Joined: 22 Sep 2006 Posts: 235
|
I found a method with 3 different signatures
MQException.getNLSMsg(arg0)
MQException.getNLSMsg(arg0, arg1)
MQException.getNLSMsg(arg0, arg1, arg2)
They are not documented. Fery few hits on google. Any idea if they may help? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jan 28, 2010 1:04 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
HenriqueS |
Posted: Thu Jan 28, 2010 2:40 pm Post subject: |
|
|
 Master
Joined: 22 Sep 2006 Posts: 235
|
MQExpcetion.getMesssage() returns Reason and CompCodes as integers, they are not easily readable for an operator.
MQConstants class, distributed with WMQ 7.0 translated such integer into an MQRC*, MQCC* string.
Well, I got some code snippets and made my own method through reflection and scanning inside the MQException fields.
But this DOES NOT works always. I saw some reason codes that by example come under the MQRCCF* prefix (example: MQRCCF_CHANNEL_ERROR) and the class MQException does not have such field. |
|
Back to top |
|
 |
HenriqueS |
Posted: Thu Jan 28, 2010 2:51 pm Post subject: |
|
|
 Master
Joined: 22 Sep 2006 Posts: 235
|
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jan 29, 2010 4:51 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
HenriqueS wrote: |
MQExpcetion.getMesssage() returns Reason and CompCodes as integers, they are not easily readable for an operator |
Is an operator really going to know what MQRC_UNKNOWN_OBJECT_Q_MGR means?
If I really had to actually solve this problem by doing something other than giving them an operations manual that listed the MQRCs and the proper operator response, I'd pipe out to mqrc.
But I really don't think that it solves the problem. |
|
Back to top |
|
 |
HenriqueS |
Posted: Fri Jan 29, 2010 8:40 am Post subject: |
|
|
 Master
Joined: 22 Sep 2006 Posts: 235
|
What usually happens here are issues out of office hours and the operators on that schedule will call me. I prefer being called 4 AM with "MQRC_UNKNOWN_OBJECT_Q_MGR" than MQRC '12345'. Still I am printing both.
Thanks for the feedback anyway.
mqjeff wrote: |
HenriqueS wrote: |
MQExpcetion.getMesssage() returns Reason and CompCodes as integers, they are not easily readable for an operator |
Is an operator really going to know what MQRC_UNKNOWN_OBJECT_Q_MGR means?
If I really had to actually solve this problem by doing something other than giving them an operations manual that listed the MQRCs and the proper operator response, I'd pipe out to mqrc.
But I really don't think that it solves the problem. |
|
|
Back to top |
|
 |
Vitor |
Posted: Fri Jan 29, 2010 9:31 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
HenriqueS wrote: |
What usually happens here are issues out of office hours and the operators on that schedule will call me. I prefer being called 4 AM with "MQRC_UNKNOWN_OBJECT_Q_MGR" than MQRC '12345'. Still I am printing both. |
I just prefer the numbers. How weird is that?  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jan 29, 2010 12:18 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Vitor wrote: |
HenriqueS wrote: |
What usually happens here are issues out of office hours and the operators on that schedule will call me. I prefer being called 4 AM with "MQRC_UNKNOWN_OBJECT_Q_MGR" than MQRC '12345'. Still I am printing both. |
I just prefer the numbers. How weird is that?  |
Me too... maybe it's because I know I can look them up using mqrc?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|