0

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 C.E.R.1.2.3.4. rather than CER1234

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

JoshMc
  • 10,239
  • 2
  • 19
  • 38
  • Are you sure it is a dot - period (char 46 x2D ) . It could be your string viewer is putting a dot for another non printable character and the dot is not a decimal 46 character. I wonder if you would see this same behavior on 2byte or 8 byte strings. – Sql Surfer Feb 01 '16 at 21:56

1 Answers1

0

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;
Community
  • 1
  • 1
Roger
  • 7,062
  • 13
  • 20