What does Windows Service Bus add to MSMQ?
Asked Answered
A

2

37

I'd like to make an informed choice towards a simple publish/subscribe architecture.

So I'm wondering: what does the Service Bus add that MSMQ can't do?
What are the drawbacks of the Service Bus?

Thx for enlightening me!

Amass answered 30/9, 2013 at 9:26 Comment(7)
+1, Interesting question. I don't know very much about Windows Service Bus, I'd love to see a detailed comparison with MSMQ. I've found this (see comments below the article): shanthuk.com/2012/11/05/windows-service-bus-vs-msmq For what it's worth, I've successfully used MSMQ in my architectures many times and definitely recommend it: lightweight, robust, transactional. See https://mcmap.net/q/426883/-key-benefits-of-msmq-closedWelterweight
Just to add (as it's often overlooked), if you are using Sql Server at all then also consider Service Broker, which is a messaging system inside the database infrastructure.Sappy
I recommend you to use NServiceBus nservicebus.com/CodeFirstGettingStarted.aspxHorny
+1. Good question. I suppose Windows Service Bus can be seen more as "Azure Service Bus on premises". It does not really "add to MSMQ", it's a completely different and new system, storing messages in SQL server.Serviceman
This should be helpful despite it compares the WSB to RabbitMQ geekswithblogs.net/michaelstephenson/archive/2012/08/12/…Wiggle
Regard MSMQ as a transport protocol. MSMQ is a support layer for higher level applications, such as service bus.Rubie
@ ken2k: thx for the bounty, I'd really like to get a complete answer. @ wudzik: why? that's in summary my question :) @ simon: true, but they provide similar functionality. where do they differ therein? @ John: an excellent explanation, but what does the higher level add?Amass
F
21

The main functional difference is Service Bus provides out of the box support for message exchange semantics such as topic based routing via publish-subscribe.

MSMQ on the other hand is a lightweight store-and-forward queuing system, which supports point-to-point one way messaging.

Service Bus:

  1. depends on SQL Server, and
  2. is a broker. This may be considered a drawback.

If you are looking at pub-sub frameworks then a popular one at the moment (free in single threaded mode) is NServiceBus, which sits on top of MSMQ, though has swap-able transport.

Furry answered 3/10, 2013 at 9:47 Comment(3)
Thanks for your answer that is useful and documented with links. +1 for the answer and the bounty reputation bonus is for you :)Welterweight
@Welterweight very gracious of you...to be honest was not expecting the bounty and I am surprised no better answers than mine were posted. This topic deserves better discussion I think.Furry
Thanks for the link to bus-and-broker-pubsub-differences page - was informative.Composer
S
9

Pros

  • Service Bus allows you to publish over tcp and http which is cool, and gives you greater decoupling.
  • Service Bus is a sql database so your Disaster Recovery is WAY simpler and a lot cheaper to implement.

Cons

  • Service Bus is centralised, and MSMQ is federated, so potentially more scalable. Although you can scale out with more nodes in WSB.
  • You need a live connection to the central bus before you can publish. So MSMQ being federated (on each machine) makes it more available to clients.

However people are using MSMQ as a local store with Service Bus, so publish locally, then push it over to the bus when a connection is available.

We are having a good experience with Service Bus instead of MSMQ at the moment.

Stabilizer answered 23/10, 2013 at 17:22 Comment(2)
can you describe the last scenario a little more? using MSMQ as a local store with SB? Does that mean you always push client message into MSMQ queues, and then how does SB leverage that?Sard
Your Web Server has msmq installed as does your Sb Server. Your Client site implements an Sb retry policy when initially trying to publish to Sb directly. If these fail stick msg on local msmq and use the inbuilt Store and forward mechanism to deliver to msmq on the Sb Server (when it becomes available.) Have a windows service on the sb server that loads msmq messages into sb queues. Alternatively add more sb nodes to your farm for more availability.Stabilizer

© 2022 - 2024 — McMap. All rights reserved.