.NET and MQSeries

MQ Postcard
IBM WebSphere MQ (previously known as "MQSeries") ships with a "postcard" app, amqpcard.exe, a simple demo that can be used to verify the installation of MQ.   The postcard app is supplied without source code.  At some point, IBM started shipping Java classes for MQ, and they also delivered a Java postcard app, including source code, to illustrate how you would connect to MQ from Java.  The Java postcard app inter-communicates with the binary postcard app.  I have produced a postcard app in C# that interoperates with both.  It's available in source form, within a Visual Studio project. 
MQ is .NET-enabled
In October 2003, IBM shipped the MQ Classes for .NET as part of CSD05 for MQSeries v5.3 on Windows.  CSD 05 (and later) for MQ v5.3 on Windows now includes a .NET library, packaged as a single assembly, amqmdnet.dll.   IBM calls this the "MQ Classes for .NET".  The library exposes an set of classes in the IBM.WMQ namespace, things like MQMessage, MQQueue, MQQueueManager, and so on, that let any .NET app directly interact with MQ.  The MQ installation on Windows can be a "server" or "client" installation - in MQ-speak, that means:  with or without a local reliable store for messages.  There is even documentation for this class library.
What can a .NET app do with MQSeries?
What can a .NET app do with MQ?  Just about anything a Java app can do, or a VB6 app using the ActiveX control for MQ, or a C-app, using the MQ API.   Put and send messages, inquire as to MQ QM properties (is it syncpoint enabled?, what version of MQ is the QM ?), do blocking or non-blocking calls, use multiple threads, participate in transactions, and so on.  The postcard app I mentioned above, shows some of the above.

What about PCF?
Within the "MQ Classes for .NET", there is also a partial implementation of the PCF stuff.  If you know MQ, you know what this means.  PCF is the Programmable Control Facility, I think, and it is basically a way to send administrative commands to MQ Queue Managers, using the MQ infrastructure itself.  PCF messages are specially formed at the sending end, and specially handled at the receiving end.  IBM started creating a set of objects that aid in "doing PCF" with .NET, but as I said, it is a partial implementation, and is not documented as far as I am aware.  PCF is documented, but the implementation of PCF within this class library is not. 
The sample app I deliver here does not do PCF or exercise any of that PCF code.
Some Further Background on MQ
In IBM-speak, CSD stands for "Cumulative Service distribution", which means "fixpack".   It's confusing because for some IBM software products, like DB2 UDB, IBM uses the actual term "fixpack".  But for others, like MQ, IBM uses "CSD".  Whatever. 
Whether called CSD or fixpack, obviously there is a different series of fixes for each product.  The latest CSD for MQv5.3 on Windows is CSD08, released in October 2004.  I think IBM recommends that you stay current with the CSDs.  You don't need to upgrade your entire MQ network at the same time.  You can upgrade your Windows server to CSD08 without touching your os390 system or AS400.  Get the latest MQ CSDs here.  

As with some other vendors, some fixpacks from IBM include new function.   CSD05 for MQ v5.3 was one of those that shipped new function, specifically, the MQ Classes for .NET.
The History around the .NET support in MQ
A long, long time ago, I think it might have been spring or summer 2002, an MQ guru and all-around good guy named Neil Kolban quietly published a class library written in C# for interacting with MQSeries.  This was, as I understand it, basically a conversion of the Java class library into C#, using the Java Language Conversion Assistant that Microsoft had released.   The .NET Class library for MQ was one of those really cool things, but it was totally unsupported.  Kind of a skunkworks project.  An illustration.  Apparently there was sufficient interest in getting "real" support for .NET in MQ that IBM made a formal effort, this time headed by the MQ lab in Hursley, to build the thing.  They started with Kolban's work and made it real.  This eventually was delivered as supportpac ma7p.  A minor digression: Supportpac is a funny term.  A supportpac is a package of complementary software -- sometimes utilities, sometimes just class libraries -- shipped by IBM.  I have only heard of them related to MQSeries, so I don't think it is an IBM-general concept.  Anyway, it's a funny term because in contrast to the name, "supportpacs"  are generally NOT supported by IBM. 
ma7p was released in February 2003, I believe.  Again there was interest from the developer community, and so IBM "promoted" the .NET classes for MQ into a bonafide part of the product, complete with full support.  This was initially released as part of CSD 05 for WMQ v.5.3, in October 2003.
Listen, if you google around on kolban.com, you can find the original MQSeries.NET package.  Don't download that.  That's the thing that is not supported.  It's still available but you really should go to the supported IBM library - get it through CSD08. 
Finally, a Disclaimer
I am not an employee of the IBM Company.  I work for Microsoft.   Anything I say about IBM or its products should be considered in that light.  For authoritative information on MQ, go to IBM. 
Comments (7)

  1. .NETicated says:

    Awhile back, I was building a .NET application which needed to do two-phase commit between MS SQL 2000

  2. Adnan says:

    hi, i am trying to run this application to connect to our MQ server (which is version 5.1). So far all i have been able to get was an error code  MQRC_Q_MGR_NOT_AVAILABLE

    I have installed the MQ client 5.3 for windows on my windows XP machine (remote client)

    I am using .NET 2.0

    I am just wondering if there is a reason I am getting this error. I have tried to telnet into the mq server and was able to do so. I have verified the channel name and the Que manager name and they are correct as well. Please let me know if you have any ideas. Could it be that i am using the MQ client version 5.3 and the Server is 5.1 that i aam not being able to connect ot he que manager?

  3. cheeso says:

    Adnan, I don’t know why you aren’t connecting to MQSeries. There’s a myriad of reasons you will get that RC from MQ.  But someone knows. I would suggest that you try your query at the forums at http://www.mqseries.net .

    Also, it seems to me that v5.1 is a very old server – and you probably need to upgrade.

  4. Heiko says:


    Tried to download the source code for the c# postcard app with no success. Is it still available??

  5. cheeso says:

    The source is still available, yes.   The site was undergoing a migration that day.  It’s up now.

  6. ANURAG says:

    Need to have details of MQ Series connectivity and using MQ Series from Dotnet

Skip to main content