Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple example of Masstransit with RabbitMQ

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.

  1. googled: But most the examples are using MSMQ or they using too many configuration options.
  2. GitHub: I looked a the GitHub for MassTransit (https://github.com/MassTransit/MassTransit/tree/master/src/Samples) But the example here is heavily loaded. It's very hard to understand for beginners.
  3. Reading docs: I have started reading docs but it will take some time before I finish it. I am hoping if someone shares a link to simple example which will get me started.

Please provide your suggestion.

like image 695
SharpCoder Avatar asked Mar 01 '13 03:03

SharpCoder


People also ask

What is MassTransit in RabbitMQ?

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.

What does MassTransit add to RabbitMQ?

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.

What is difference between RabbitMQ and MassTransit?

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?

Who uses MassTransit? 9 companies reportedly use MassTransit in their tech stacks, including Alibaba Travels, Trendyol Group, and Logiwa.


2 Answers

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!

like image 123
Chrysalis Avatar answered Sep 23 '22 17:09

Chrysalis


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.

like image 27
Eugene Tolmachev Avatar answered Sep 22 '22 17:09

Eugene Tolmachev