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 IndexIBM MQ API SupportProblem with message properties

Post new topicReply to topic
Problem with message properties View previous topic :: View next topic
Author Message
ktg
PostPosted: Fri Jan 16, 2009 2:31 am Post subject: Problem with message properties Reply with quote

Centurion

Joined: 09 Jan 2006
Posts: 138
Location: India

Hi All,

We are trying to construct a request message using message properites feature of MQ7. We want property name as "-m" and its value to be "TESTQMGR". Used the sample program AMQSSTMA. But we are getting error: 2442 ( MQRC_PROPERTY_NAME_ERROR).

Changed the following API call:
Code:
        MQSETMP(Hcon,            /* connection handle               */
                 Hmsg,            /* message handle                  */
                 &smpo,           /* set message property options    */
                 &vs,             /* property name                   */
                 &pd,             /* property descriptor             */
                 MQTYPE_STRING,   /* property data type              */
                 valuelen,        /* value length                    */
                 value,           /* value buffer                    */
                 &CompCode,       /* completion code                 */
                 &Reason);        /* reason code                     */

to

Code:
         MQSETMP(Hcon,            /* connection handle               */
                 Hmsg,            /* message handle                  */
                 &smpo,           /* set message property options    */
                 &vs,             /* property name                   */
                 &pd,             /* property descriptor             */
                [color=darkred]MQTYPE_BYTE_STRING[/color],   /* property data type              */
                 valuelen,        /* value length                    */
                 value,           /* value buffer                    */
                 &CompCode,       /* completion code                 */
                 &Reason);        /* reason code                     */

Still no change in output.

The explanation for 2442 error say "The name contained an invalid character"

Whether "-" is a invalid charater for MQTYPE_STRING/MQTYPE_BYTE_STRING ?
or
What shold we do so as to pass "-m" as property name?

Could any one please help.

TIA,
Kalpana
Back to top
View user's profile Send private message AIM Address
fjb_saper
PostPosted: Fri Jan 16, 2009 4:00 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Have you considered that when changing from MQ_STRING to MQ_BYTE_STRING you might also have to change the valuelen as the value buffer size might have changed???

I expect that for the same text being passed the buffer size will change from a single character charset to a double character charset...

In any case the manual and verify that all your other values in the call are still correct...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Fri Jan 16, 2009 4:10 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.csqzal.doc/fg20110_.htm

Says that "All property names must follow the rules defined by the Java™ Language Specification for Java Identifiers, with the exception that Unicode character U+002E (“.”) is permitted as part of the name - but not the start. The rules for Java Identifiers equate to those contained in the JMS specification for property names."

So I'd suspect you can include "-" in your property name but not as the FIRST character.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jan 16, 2009 4:34 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Looks to me like some command line argument is being passed.
Would it not be better to pass this in a generic form like
property name= "parm_n" value "-m"
property name= "parm_n+1" value "QMGRNAME"

Jeff is there a restriction on property values as well? I did not think so...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Fri Jan 16, 2009 4:42 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I've not really played with the property API yet, so I'd have to go back to the link I just posted and read again to see if there are any rules about property values.

I'd assume, more or less, that any limits are going to be the same as you'd find in JMS properties in general.
Back to top
View user's profile Send private message
ktg
PostPosted: Fri Jan 16, 2009 4:52 am Post subject: Reply with quote

Centurion

Joined: 09 Jan 2006
Posts: 138
Location: India

MQBYTE and MQCHAR both are of char size in Windows - the OS which am using. Hence, size/memory is not an issue.

"-" is not being accepted in any position. Will go through "Java™ Language Specification for Java Identifiers" to check whether "-" is a valid character for identifier.

Thanks,
Kalpana


Last edited by ktg on Mon Jan 19, 2009 2:15 am; edited 1 time in total
Back to top
View user's profile Send private message AIM Address
ktg
PostPosted: Mon Jan 19, 2009 2:12 am Post subject: Reply with quote

Centurion

Joined: 09 Jan 2006
Posts: 138
Location: India

As per Java™ Language Specification for Java Identifiers, an identifier can contain only uppercase and lowercase ASCII latin letters, underscore and doller sign( A-Z, a-z,_,$). Can have Ascii digits(0-9) but not at the first place. (Ref: Section 3.8 http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html)

Thanks,
Kalpana
Back to top
View user's profile Send private message AIM Address
ktg
PostPosted: Tue Jan 20, 2009 10:57 pm Post subject: Reply with quote

Centurion

Joined: 09 Jan 2006
Posts: 138
Location: India

If we specify
cmho.Options = MQCMHO_NO_VALIDATION
for MQCRTMH call, we wont get the error.

Thanks,
Kalpana
Back to top
View user's profile Send private message AIM Address
fjb_saper
PostPosted: Wed Jan 21, 2009 3:41 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

ktg wrote:
If we specify
cmho.Options = MQCMHO_NO_VALIDATION
for MQCRTMH call, we wont get the error.

Thanks,
Kalpana

But you might be loosing compatibility with JMS this way?
Just because something is possible does not mean it should be done: think cold war and M.A.D. and be glad that was never done.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ API SupportProblem with message properties
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.