20

I'm currently doing analysis and design for a new message bus architecture in my company. I have tried MSMQ to do something like this in the past and it works well and was thinking of doing the same thing again for this project but using WCF as the API instead of using the System.Messaging API. Has anyone had experience with MSMQ in WCF? Is it easier to use then the System.Messaging API? What would be some benefits of using WCF over System.Messaging or vice versa?

heartlandcoder
  • 647
  • 1
  • 5
  • 14

3 Answers3

32

IMHO, with so many good, flexible and proven bus architectures to choose from (NServiceBus, Mass Transit, Rhino Service Bus), implementing your own would be a big NIH. It's not a trivial task.

Udi describes it very well in this message.

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
  • mausch thank you for the information about the message bus systems already out there. I didn't know that there were already systems like this open to the public! – heartlandcoder Apr 06 '09 at 22:00
  • 1
    How is this an answer to the OP's question of what is essentially should he use straight-up **MSMQ** or **WCF with MSMQ binding**? **RoadWarriors** answer below I feel is more in line with the OP's question. –  Aug 09 '14 at 15:57
5

Sorry, coming very late to this, but hopefully my answer is useful for MSMQ 4.0 users (but not necessarily useful to users of later versions).

Both WCF Queuing and System.Messaging are wrappers over the MSMQ APIs. WCF is more sophisticated and complex, but does have the following benefits:

  • An OO view of your application's business processes rather than its communication plumbing.
  • End-to-end message encryption and authentication for free. System.Messaging only supports encryption on the wire, not in the store.
  • If you wish, you can host within IIS rather than building your own custom host.
  • Message correlation for free. This allows you to group messages into sessions automatically.
  • Transactional batching for free.
HTTP 410
  • 17,300
  • 12
  • 76
  • 127
  • With WCF you don't need to have IIS installed to provide any kind of service.Misleading answer. – argatxa May 31 '11 at 20:35
  • 1
    @argatxa: I'm saying that with WCF you can host within IIS. I agree that you don't need to host within IIS. I'll edit my answer to reflect this. – HTTP 410 Jun 07 '11 at 10:28
  • @RoadWarrior Your first comparison is correct however you are incorrect in others. 1) Both MSMQ and WCF have correlation IDs. 2) MSMQ has transactions 3) MSMQ uses authentication as well as authorisation. Also it could be argued that MSMQ is harder than WCF simply because it is a MOM API –  Aug 09 '14 at 16:05
  • 1
    @Micky: This answer was 5 years ago and discusses MSMQ 4.0. I think you should create your own answer based on the current version (6.3). I've long since moved on to RabbitMQ. – HTTP 410 Jan 24 '15 at 01:15
3

the Apache ActiveMQ (open source) message broker also has a .NET client:

http://activemq.apache.org

Together with Apache Camel and Apache ServiceMix, enterprise integration patterns and enterprise service bus systems are easy to set up.

mjn
  • 36,362
  • 28
  • 176
  • 378