简体   繁体   中英

Dot appended to the end of MQ message when passing it from C# .Net application to IBM MQ

I am passing message from C# .NET 4.0 to MQ version: 7.5.0.5 . Snippet of the code

queue = queueManager.AccessQueue(strQueueName, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);

queueMessage = new MQMessage();

queueMessage.Format = MQC.MQFMT_STRING;
queueMessage.MessageType = 8;

queueMessage.CharacterSet = 1208; 

queueMessage.WriteUTF(message);

queuePutMessageOptions = new MQPutMessageOptions();
queue.Put(queueMessage, queuePutMessageOptions);
messageWrittenSuccessfully = true;
queue.Close();

I am getting the message with character followed by dot CER1.2.3.4. rather than CER1234

not sure if this is related to encoding or CCIS issue.

Set your CharacterSet to 437 for ASCII. Here is a nice long explanation of your issue.

Also, you should be using the MQ defines for MessageType:

queueMessage.MessageType = MQC.MQMT_DATAGRAM;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM