Question

I'm brand new to WebSphere MQ. I'm using IBM's .NET classes (IBM.WMQ) to put a request message and then get a response message. The MQMessage object has a number of Writexxx methods for various data types. I need to write a variety of different data elements to the request message. My question is, should I call the appropriate Write method for each individual data element, or should I build the whole thing with a StringBuilder and then call the MQMessage WriteString method once?

Was it helpful?

Solution

The write APIs are to try an help you write clearer code, but whoever converted the WMQ API to .Net is an idiot.

They wrote 20 different APIs instead of a "write" function with overloads. The write call has a few usable overloads.

They created one enum which has 100's if not thousands of options called MQC (MQ Constants). Have fun, but beware of transactions on WMQ, as there is a *cough small cost involved in using that functionality.

Now that I'm done with my rant, beware of the APIs that most of the apis have a limitation of an signed int in terms of size, only the write(byte[] array) and the writestring(string s) function take a large message. Also the .net api writes all strings UTF-16 as per .net's implementation which may affect you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top