I’m using WebSphere MQ v7 Server and WebSphere MQ Client v7.5 with amqmdnet.dll 7.5.0.0 as .NET library for communicating over WebSphere MQ. Sometimes when I try to read MQMessage from the queue I get MQException with MQRC_RFH_FORMAT_ERROR reason.
var message = new MQMessage();
queue.Get(message);
This behavior seems dependent on the sender of the message and on its content. It usually doesn’t work with systems on different platform sending messages with float or double properties.
This is a globalization bug in IBM’s amqmdnet.dll. After turning on MQ tracing on the client (
strmqtrc.exe) I tried to receive message again and I found this in one of trace files:Decompiling
MQMarshalMessageForGetwith .NET Reflector showed this:The messages are read in the current system’s culture not in transport expected culture (which should be same on all platforms)! Simple test to reproduce the issue:
Workaround
I’m using this simple scope class:
And I’m wrapping every
Getcall to the scope.