Implementing a Message Bus architecture

2019-01-21 08:31发布

问题:

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?

回答1:

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.



回答2:

Sorry, coming very late to this, but hopefully my answer is useful.

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.


回答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.