Author |
Message
|
WBI_user |
Posted: Fri Jan 27, 2006 8:42 pm Post subject: How to set MQ format from a MQe message. |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
I have sent MQe message from pocketpc2002 to bg MQ over the MQe gateway. I used mqemqmmsgobject so that message is getting onto the MQ queue in MQ format. However the MQ_FMT field is blank in the MQMD. This caused data conversion problem when the message was moved from the MQe gateway machine (WinXP) to MVS.
I am writing the MQe program on PocketPC2002 in C (not java).
The C programming reference mentioned about
FIELD_NAME_MQ_FORMAT but there is not example on how to do it.
I tried
rc = mqeFields_putArrayOfByte(hMQMessage,&exceptBlk,FIELD_NAME_MQ_FORMAT ,"MQSTR",5);
But the message was stuck on the PocketPC. If I removed this statement, the message will go across fine. However the format field is blank.
Any help ? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jan 28, 2006 10:34 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Could it be because the size of the FORMAT field is more than 5. I think you need to fill with spaces for any unused byte.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
WBI_user |
Posted: Sat Jan 28, 2006 11:06 am Post subject: |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
I have since changed my code to
rc = mqeString_newChar8(&exceptBlk,&hFormat,"MQSTR "); /*(8 char)*/
rc = mqeFields_putAscii(hMQMessage,&exceptBlk,FIELD_NAME_MQ_FORMAT , hFormat);
and it is still failing. I also found out that it the transformer in the gateway that is throwing an exception saying that the daya type is wrong for MQ_Format. But I always think that format MQSTR is alsways char. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jan 28, 2006 11:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Setting the format to MQSTR means that only characters are allowed. Any numbers must be sent as their character representations. So no hex or compressed numeric formats embedded in your strings.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
YATAWAL |
Posted: Tue Jan 31, 2006 8:18 am Post subject: |
|
|
Apprentice
Joined: 26 Feb 2004 Posts: 25
|
You may wish to try the supplied function setFormat in ..\MQe\C\include\published\MQe_MQMessage.h which is
MQERETURN MQEPUBLISHED mqeMQMessage_setFormat(MQeMQMessageHndl hMsgObj, MQeExceptBlock *pErrStruct, MQeStringHndl hFormat); |
|
Back to top |
|
 |
WBI_user |
Posted: Sat Feb 11, 2006 9:21 am Post subject: |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
Even the manual says FIELD_NAME_MQ_FORMAT is ASCII. Use
mqeFields_putUnicode instead of mqeFields_putAscii fixed the problem. |
|
Back to top |
|
 |
|