WCF-NetMsmq vs MSMQ adapter

The upcoming BizTalk Server R2 extends heavily the messaging capabilities of BizTalk Server.  Together with the rich messaging engine the WCF adapters and the WCF Line of Business Adapters SDK opens a whole new set of possibilities for developers. However, there is still some overlapping between the messaging features of BizTalk and WCF that developers must understand in order to apply the correct technology to a particular scenario. One of the most interesting scenarios with these characteristics is the interaction with MSMQ for achieving asynchronous and persistent messaging. Since the 2004 release BizTalk Server includes a MSMQ adapter for addressing this type of interaction. Now, with the WCF adapters included in R2 it is possible to use the WCF-NetMsmq and the WCF-Custom adapters for achieving similar scenarios. The question then becomes when to use one option versus the other.

The main difference between two approaches relies on the fact that the MSMQ adapter should be considered for pure MSMQ interaction whereas the WCF adapters should be used for Service Oriented interactions in which MSMQ is used as the persistent mechanism. I tried to put together a simple list that highlights some of these differences.

·         Contract-based interfaces: The use of the WCF-NetMsmq adapter makes the Service, Data and Message contracts available to the client at design time. In the case of the MSMQ adapter the clients does not have any type information at design time.

·         SOAP based messaging: The WCF-NetMsmq adapter uses SOAP as the encoding mechanism.

·         Message based security: The use of the WCF-NetMsmq adapter allows the use of WS-* security protocols for encrypting and signing parts of the SOAP message.

·         Other WS-* protocols: Although MSMQ natively addresses some aspects, such as persistent, transactionality and reliability, some WS-* protocols can be used with the WCF-NetMsmq adapter as a complement to MSMQ native features.

·         Session based messaging: WCF introduces the concept of a session as a mechanism to group a set of related messages together for processing by a single receiving application. This feature can be leveraged natively by the WCF-NetMsmq adapter.  

·         Batched messaging: (Do not confuse this with BizTalk batching): Similarly to Session based messaging, the WCF-NetMsmq adapter can take advantage of the TransactedBatchingBehavior WCF behavior to group unrelated messages in a single batch.

·         Poison message handling: WCF, and consequently the WCF-NetMsmq adapter, provides a rich set of options for handling poison messages after a message has exceeded the maximum number of delivery attempts to the application

Published Wednesday, April 25, 2007 10:15 PM by gsusx
Filed under: ,


# re: WCF-NetMsmq vs MSMQ adapter

Good Article...

So this shows all advantages of WCF-NetMsmq over MSMQ adapter, can there be any scenario where one can prefer MSMQ adapter over WCF-NetMsmq?

Friday, May 4, 2007 12:34 AM by Amit Rohilla

# re: WCF-NetMsmq vs MSMQ adapter

In my opinion, MSMQ should be use for pure messaging scenarios in which you don't need a service contract around the msmq messaging infrastucture

Friday, May 4, 2007 3:49 PM by Jesus Rodriguez

# re: WCF-NetMsmq vs MSMQ adapter

We rely on msmq transactions within our orchestrations. Does the wcf-netmsmq binding support transactions, and could it then replace the msmq adapter. Since the msmq service needs to run localy to support transactions, using netmsmq, might simplyfy things.

Thursday, May 22, 2008 5:17 AM by Mikael Håkansson

# re: WCF-NetMsmq vs MSMQ adapter

does netMSMQ use queues?

Can I do a peek on a messsage?

Wednesday, January 7, 2009 6:17 AM by impossible