Author |
Message
|
ktg |
Posted: Fri Jan 16, 2009 2:31 am Post subject: Problem with message properties |
|
|
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 |
|
 |
fjb_saper |
Posted: Fri Jan 16, 2009 4:00 am Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Fri Jan 16, 2009 4:10 am Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Fri Jan 16, 2009 4:34 am Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Fri Jan 16, 2009 4:42 am Post subject: |
|
|
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 |
|
 |
ktg |
Posted: Fri Jan 16, 2009 4:52 am Post subject: |
|
|
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 |
|
 |
ktg |
Posted: Mon Jan 19, 2009 2:12 am Post subject: |
|
|
Centurion
Joined: 09 Jan 2006 Posts: 138 Location: India
|
|
Back to top |
|
 |
ktg |
Posted: Tue Jan 20, 2009 10:57 pm Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Wed Jan 21, 2009 3:41 am Post subject: |
|
|
 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 |
|
 |
|