WebSphere MQ .NET API
Is there a WebSphere MQ .NET API I 开发者_开发技巧can download ? I am basically trying to write a C# app that listens for messages in an MQ queue.
MQ, since v5.3 fixpack 8 on Windows, includes amqmdnet.dll, a .NET assembly that provides managed-code programming model for MQSeries. It's supported by IBM.
IBM Calls it the "MQ Classes for .NET"
If you have MQ, you probably have this assembly.
C:\Program Files\IBM\WebSphere MQ\bin\amqmdnet.dll
Reference
WMQ v6 goes End-of-Life as of Sept 2011. Do yourself a favor and start with the v7 client instead of the v6 client. Preferably, you want the QMgr to be at v7 as well since the .Net functionality has been greatly improved in the latest version. That said, the v7 client will work with a v6 QMgr, you just don't get all the new v7 functionality. However, it does save you from having to redeploy the client in 18 months when v6 becomes unsupported.
After you install, look in the install dir/tools/dotnet/samples/cs directory for some sample code. Here are some links to the docs to help you get started:
IBM - WebSphere MQ Help (Look for the Using .Net manual)
IBM - WebSphere MQ - SupportPacs by Product
In MQ 7 they even added a WCF transport channel for WMQ. Basicly this means that you also don't have to write the code that listens for messages, you can just use the WCF plumbing.
WCF samples are also in the samples dir.
The latest client is v7 and can be found here http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg24019253&loc=en_US&cs=utf-8&lang=en just download and install in order to get the .dll
There's also a WebSphere transport for NServiceBus available on http://particular.net that will take care of all of the difficult transaction and threading issues and give you the same nice and clean message-driven API as if you were using MSMQ.
精彩评论