Gerben van Loon

Random thoughts on Microsoft Software Development and other related stuff

IBM WebSphere MQ WCF Channels

See some update here: http://bloggingabout.net/blogs/gerben/archive/2010/12/20/ibm-websphere-mq-wcf-channels-updated.aspx

Windows Communication Foundation out of the box ships with quite some transport mechanisms. By default it comes with http, tcp, msmq, etc. A channel for the quite widely used IBM WebSphere MQ (WMQ) transport is missing.

To clarify terms up: the WCF thing that really puts the messages on the wire is generally referred to as a channel, transport or transport channel. To able to use that thing in WCF in config you need a binding. A transport combined with a binding is sometimes called an adapter.

Due to history or cross platform support quite some companies are still using WMQ. In the past I've extended WCF with a custom channel for WMQ for a company I worked for and that works fine. Though you actually don't want to build these kinds of things since they're quite complex. Especially if your need robust high volume processing. Luckily enough though both Microsoft and IBM have recently shipped a WCF transport for WMQ. Microsoft ships it with Host Integration Server (HIS) 2009 which is part of BizTalk. HIS is just the shipping vehicle, you don’t need it at runtime. IBM had a transport in alpha for while but it now ships it with WMQ version 7. I evaluated both of these transports and below is my comparison:

 

IBM

HIS2009

Fire-and-forget (oneway) client

+

+

Fire-and-forget (oneway) service

+

+

Request-reply client

+

-

Request-reply service

+

-

Local transactions

+

-

Distributed transactions (DTC)

-

+

Client side transactions (DTC)

-

+

Backout queue support

+

-

Message format

-

+

AppFabric support / IIS Hosting
(WAS listener for IIS7)

-

-

Works with .NET 3.x

+

+

Works with .NET 4.0

+

+

WMQ6 support

-

+

WMQ7 support

+

+

Sample code

+

+

Documentation

+

-

Licensing

+

-

Transaction support
Distributed transaction via DTC only supported in HIS component. Be aware though that you need the WMQ Extended Transactional Client for this, which comes with extra license costs and that HIS2009 doesn’t support backout queues. If the transaction fail it will start to retry indefinitely (poison message) unless you handle this yourself someway.

A local transaction means just that the get from the queue will not be committed in the case of an unhandled exception in the transport channel, WCF runtime or in your own service implementation code. IBM uses a WCF behavior to implement this.

Message format
The IBM channel ties the transport channel to messages with MQHRF2 header, JMS header and puts messages as JMS byte message on the queue. Not a real big surprise since the class name of the channel is "IBM.XMS.WCF.SoapJmsIbmTransportChannel". The IBM channel itself is able to receive messages without all this stuff. But a put on the queue will always be with all this stuff. Disabling via targetClient=1 in the JMS binding is currently not supported.

Sample code / documentation

HIS Channel:
- Samples after installation of “Host Integration Server 2009” or “BizTalk Server 2009 adapters for host systems” available in: \Program Files\Microsoft Host Integration Server 2009\SDK\Samples\MessageIntegration\MQChannel

- Documentation not available is work in progress. Channel is under the cover the same as the BizTalk MQ Series Client adapter, so maybe some documentation from that adapter applies for this one.

IBM.
- After install of WMQ 7 client in: \Program Files\IBM\WebSphere MQ\tools\wcf\samples

Documentation:
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzav.doc/un12000_.htm

Licensing
IBM: component is shipped with WMQ client or server version 7.

HIS:
Despite that you only need the assemblies and no BizTalk or HIS to get it working licensing is still via BizTalk. Cheapest way if you're just using the assemblies on a non BizTalk server is to go with the branch edition.

Details at:
http://download.microsoft.com/download/3/9/E/39EB3E63-997C-47CA-9316-AA0B6CD7F9B8/Microsoft%20Host%20Integration%20Server%202009%20FAQ.docx

http://www.microsoft.com/biztalk/en/us/pricing-licensing.aspx

Conclusion
It all looked very nice at first that both Microsoft and IBM are shipping a WCF channel for WMQ. Major disadvantages for me for the Microsoft one are the licensing model and that they don't support request-reply. The IBM channel doesn't have these problems but is missing WMQ 6, distributed transactions and non JMS support for puts on the other side.

Yes I know queues aren't meant for request-reply communication. But there are still quite some old systems around that only are accessible via WMQ, that's why I want request-reply over WMQ.

I know via the TAP that HIS2010 will add some new stuff to the WCF WMQ transport. I’ll update my comparison when HIS2010 is released.

Comments

Gerben van Loon said:

# March 12, 2010 5:34 PM

odanvin said:

Hi Gerben, you are saying: "Uncaught exception in service rolls back message to queue."

I've tried to raise an exception in the service implementation of the SimpleOneWay_Service found in the Samples of IBM WebSphere MQ WCF Channels but the messages seem not rolled back to their queues. Is there anything to consider for observing what you've said?

# June 9, 2010 12:45 PM

odanvin said:

Forget my comment Gerben. I finally found it in the documentation of IBM WebSphere MQ WCF Channels, we have to use the [AssuredDelivery] attribute on the service implementation.

# June 9, 2010 2:55 PM

Gerben van Loon said:

Jup you need to add the attribute, it's not the default behavior.

# June 10, 2010 1:42 PM

Kishore said:

Hi,

 I am from a java background and am writing some new WCF services. I have a need to invoke a WCF service whenevr there is a message in a MQ queue.

Can you suggest ways of implementing this ? Is there something like MDB in the wcf framework which can do this with MQ

# June 19, 2010 8:52 PM

Gerben van Loon said:

Hi Kishore,

Yes sure, this is exactly what these channels can do for you without having to program much.

Both channels have samples of this scenario. For the IBM one in: OneWayService.cs or RequestReplyService.cs. For the Microsoft one in the SendReceiveSample. You can find them in the samples directory, see the post on where that is.

# June 24, 2010 10:31 AM

Gerben van Loon said:

# July 20, 2010 4:18 PM

Gerben van Loon said:

Some updates to my original post since Microsoft Host Integration Server 2010 is released. My comparison

# December 20, 2010 3:38 PM

Jan Odegard said:

Nice roundup Gerben.

I've been doing some testing with both these channels, and they seem to have a curious shortcoming in that they only support queue managers whose names are in all lower case. Did you stumble upon the same problem? A rather strange shortcoming, wouldn't you say?

In short, this means that we really can't use any of them, as all our queues are all caps.

# January 11, 2011 10:49 AM

Gerben van Loon said:

Hi Jan,

No I didn't, sounds strange. All our queue names and queue manager names are also upper case and it works fine. Think the error should be somewhere else instead of on the queue names?

Cheers,

Gerben.

# February 7, 2011 5:51 PM

Jan Odegard said:

Hi, Gerben.

Thanks for responding.

I haven't been able to figure out the quirk with uppercase queue manager names, but I was wondering if you have used these channels with BizTalk as well?

Using the channels from code, upper case qm names works fine, but not when used as transport channels in a WCF-custom port in BizTalk.

Any thoughts?

Regards,

Jan

# February 21, 2011 5:53 PM

Gerben van Loon said:

Sorry for the late response: nop not used in BizTalk. Only from code.

# June 1, 2011 10:37 PM

Gerben van Loon said:

Wrote a lot about the IBM WebSphere MQ WCF Channels in the past. Check out my original post and an update

# August 16, 2011 10:11 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Please add 8 and 1 and type the answer here: