I am trying to send MQ message from .NET application using amqmdnet library. I put to queue simple message with two string properties like that:
var message = new MQMessage();
message.SetStringProperty("MessageID", Guid.NewGuid().ToString());
message.SetStringProperty("DocType", docTypeVal);
foreach (var b in content)
{
message.WriteByte(b);
}
var o = new MQPutMessageOptions();
var q = IBM_mqm.AccessQueue(ConnectionOptions.QueueNameOutput, MQC.MQOO_OUTPUT
+ MQC.MQOO_FAIL_IF_QUIESCING);
q.Put(message, o);
q.Close();
It works perfect when property "DocType" contains only latin symbols, digits and other general symbols.
message.SetStringProperty("DocType", "SomeEngText");
But when the property contains cyrillic symbols the message becomes unreadable. It's format becomes MQRFH2 despite the fact that I never set it. And named properties are empty.
message.SetStringProperty("DocType", "Договор купли продажи ТС");
When I am trying to read this message from my client an error 6106 MQRC_ENCODING_ERROR comes.
Some cyrillic values works fine (for example, "Кредитный договор"), but most of them breaks the message.
I tried to specify CCSID of the message like that:
message.CharacterSet = MQC.CODESET_UTF;
And also to set format:
message.Format = MQC.MQFMT_NONE;
But it didn't help. How can I fix it?
