简体   繁体   English

从C#.Net应用程序传递到IBM MQ时,将点附加到MQ消息的末尾

[英]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 . 我正在将消息从C#.NET 4.0传递到MQ版本: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. 我收到的消息是字符后跟点CER1.2.3.4。 rather than CER1234 而不是CER1234

not sure if this is related to encoding or CCIS issue. 不知道这是否与编码或CCIS问题有关。

Set your CharacterSet to 437 for ASCII. 将ASCII字符集设置为437。 Here is a nice long explanation of your issue. 是您问题的详尽说明。

Also, you should be using the MQ defines for MessageType: 另外,您应该使用MessageType的MQ定义:

queueMessage.MessageType = MQC.MQMT_DATAGRAM;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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