Why do we need a service bus infrastructure like NService Bus / MassTransit on top of message queuing systems like MSMQ / RabbitMQ etc.?

In the world of distributed messaging transactions, I'm trying to understand the different parts that are involved in developing distributed systems. As I understand it, you can create a messaging system using a corporate bus with support for the message queuing system. Why is it a good idea to use both? Can this be achieved by programming against the message queuing system? What are the benefits of using both together?

+5
source share
3 answers

Of course, you can directly code the messaging infrastructure, and you will find that there are pros and cons to wrt each transport. However, there are many decisions that you will need to make along the way, and this is where the service bus can help.

Designing directly against the queuing system will inevitably lead to various abstractions that will be required to prevent duplication.

The service bus will provide views / implementations for:

  • Message delivery
    • exactly once (distributed transactions - distributed transactions are not supported by all queue systems)
    • at least once (not transactional)
    • at-most-once (some transaction processing may be required, but you can avoid unallocated transactions )
  • Retrying failed messages
  • Request / Response
  • Message distribution
  • Publish / sign (perhaps quite simple with RabbitMQ directly, not much with MSMQ directly)
  • Idempotent Messages
  • Dependency Injection

Some service bus implementations provide the basis for the implementation of process managers (most of them are called sagas). My real opinion is that the process manager should be a first-class citizen, like any other object, but which can change :)

Anyway, if you are still evaluating the parameters, you can also take a look at my FOSS project: http://shuttle.imtqy.com/shuttle-esb/

Thus, the service bus can buy you quite a lot of ready-made code, while coding against queues directly can be a little difficult to work with.

+17
source

I cannot comment directly on MassTransit, only redoing it.

I use NServiceBus and am a fan of it. I think there are good reasons to directly use queuing technology, but I think that starting your own ESB using MSMQ / RabbitMQ will cost a lot more than just using a commercial product (or an open source product like MassTransit).

So do you need it? Not. Will your life be much easier if the specifications meet your requirements? That's right.

+3
source

Here's something from the MassTransit documentation itself (I don't think it was there when the question was first submitted):

What does MassTransit add on top of MSMQ and RabbitMQ?

+2
source

Source: https://habr.com/ru/post/1203054/


All Articles