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 » Lookup MQ constants (integer to String) in WMQ 6.0

Post new topic  Reply to topic
 Lookup MQ constants (integer to String) in WMQ 6.0 « View previous topic :: View next topic » 
Author Message
HenriqueS
PostPosted: Thu Jan 28, 2010 8:59 am    Post subject: Lookup MQ constants (integer to String) in WMQ 6.0 Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Jan 28, 2010 9:07 am    Post subject: Re: Lookup MQ constants (integer to String) in WMQ 6.0 Reply with quote

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
View user's profile Send private message Send e-mail
HenriqueS
PostPosted: Thu Jan 28, 2010 11:04 am    Post subject: Re: Lookup MQ constants (integer to String) in WMQ 6.0 Reply with quote

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
View user's profile Send private message
HenriqueS
PostPosted: Thu Jan 28, 2010 12:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Thu Jan 28, 2010 1:04 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

So you're looking for a v6 version of
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.javadoc.doc/WMQJavaClasses/com/ibm/mq/constants/MQConstants.html

That?

And although you found MQException.getNLSMsg, you were unable to find

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/uj24280_.htm

?
Back to top
View user's profile Send private message
HenriqueS
PostPosted: Thu Jan 28, 2010 2:40 pm    Post subject: Reply with quote

Master

Joined: 22 Sep 2006
Posts: 235

mqjeff wrote:
So you're looking for a v6 version of
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.javadoc.doc/WMQJavaClasses/com/ibm/mq/constants/MQConstants.html

That?

And although you found MQException.getNLSMsg, you were unable to find

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/uj24280_.htm

?


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
View user's profile Send private message
HenriqueS
PostPosted: Thu Jan 28, 2010 2:51 pm    Post subject: Reply with quote

Master

Joined: 22 Sep 2006
Posts: 235

Well, I found this:

http://www.koders.com/java/fid1189B2137835FC89CA26A8060EB233B41ED6FC4E.aspx?s=RFH

Looks like it has all MQRC* fields up to version WMQ 6.0. I will solely adapt it also to return MQCC* strings (it´s few).
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jan 29, 2010 4:51 am    Post subject: Reply with quote

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
View user's profile Send private message
HenriqueS
PostPosted: Fri Jan 29, 2010 8:40 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Jan 29, 2010 9:31 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Jan 29, 2010 12:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Lookup MQ constants (integer to String) in WMQ 6.0
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.