I want to use MassTransit bus with RabbitMQ. But I am not able to find a simple example. I am looking for example which will get me started.
What I have tried.
Please provide your suggestion.
What is MassTransit? MassTransit is a free, open-source, distributed application framework for . NET applications. It abstracts away the underlying logic required to work with message brokers, such as RabbitMQ, making it easier to create message-based, loosely coupled applications.
MassTransit provides a heavily production tested convention for using RabbitMQ exchanges to route published messages to the subscribed consumers. The structure is CPU and memory friendly, which keeps RabbitMQ happy.
With RabbitMQ, which supports exchanges and queues, messages are sent or published to exchanges and RabbitMQ routes those messages through exchanges to the appropriate queues. When the bus is started, MassTransit will create exchanges and queues on the virtual host for the receive endpoint.
Who uses MassTransit? 9 companies reportedly use MassTransit in their tech stacks, including Alibaba Travels, Trendyol Group, and Logiwa.
Here's a simple, good pub-sub example using MassTransit and RabbitMQ both. http://looselycoupledlabs.com/2014/06/masstransit-publish-subscribe-example/
In case the article link does not work, here's the link to the source code: https://github.com/dprothero/MtPubSubExample
Thanks to the author of course!
MassTransit implements a lot of concepts and provides great many features with a very small surface API. There's no simple way to describe everything it does, because the problems it helps to solve are not simple, but an example can be made small.
Have a look at this sample I have for testing throughput: https://github.com/et1975/Throughput-Test
The only "extra" that one might find unnecessary is Dependency Injection integration. You'd want one in most cases, but it does hide how certain bits interact.
Look at https://groups.google.com/forum/?fromgroups#!forum/masstransit-discuss for more help.
Cheers, ET.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With