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 Telemetry / Low Latency Messaging / Everyplace » How to set MQ format from a MQe message.

Post new topic  Reply to topic
 How to set MQ format from a MQe message. « View previous topic :: View next topic » 
Author Message
WBI_user
PostPosted: Fri Jan 27, 2006 8:42 pm    Post subject: How to set MQ format from a MQe message. Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Sat Jan 28, 2006 10:34 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
WBI_user
PostPosted: Sat Jan 28, 2006 11:06 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Sat Jan 28, 2006 11:27 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
YATAWAL
PostPosted: Tue Jan 31, 2006 8:18 am    Post subject: Reply with quote

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
View user's profile Send private message
WBI_user
PostPosted: Sat Feb 11, 2006 9:21 am    Post subject: Reply with quote

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

MQSeries.net Forum Index » IBM MQ Telemetry / Low Latency Messaging / Everyplace » How to set MQ format from a MQe message.
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.