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.
source share