Тёмный

An introduction to MassTransit using RabbitMQ (In ASP.NET Core) 

DotNet Core Central
Подписаться 27 тыс.
Просмотров 47 тыс.
50% 1

In my last few videos, I have covered concepts of message broker using RabbitMQ. After covering the basic concepts of RabbitMQ, it's a natural progression to discuss MassTransit.
The video links for RabbitMQ fundamentals are here:
Video 1 (Installing RabbitMQ and fundamentals of a message broker): • RabbitMQ in .NET Core ...
Video 2 (Direct Exchange): • RabbitMQ Direct Exchan...
Video 3 (Header and Topic Exchange): • RabbitMQ Topic Exchang...
Video 4 (Reactive microservice with RabbitMQ): • Building Reactive Micr...
First, let us understand, what is MassTransit. MassTransit is an open-source framework for building distributed applications in .Net. Key features of MassTransit are:
1. Out of box integration available for RabbitMQ, ActiveMQ, Azure Service Bus, and Amazon SQS/SNS.
2. Supports message patterns such as event-driven state machines, sagas, message consumers, and support for distributed transactions.
3. Supports in-memory test harness, which makes it very easy to implement unit and integration tests.
4. Advanced monitoring features such as distributed tracing and service health checks.
In this video, I will walk through the basic concept of using MassTransit with RabbitMQ and build a couple of reactive microservices for communicating messages.
The source code for this video is available in my GitHub repo here: github.com/cho...

Опубликовано:

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 71   
@vinr
@vinr Год назад
Even after two years, this is the best explanation on the subject, and I wish you continue to produce quality content, subbed!
@DotNetCoreCentral
@DotNetCoreCentral Год назад
Thanks, will do!
@Anja5233
@Anja5233 Год назад
FOR ANYONE WATCHING IN 2023: AddMassTransitHostedService() is not necessary anymore, if it throws an error just delete it
@letsoverengineer
@letsoverengineer 3 года назад
Wow, so simply - thank you for the first half of the video - it helped understanding the api a lot!
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Michal Bilinski, thanks for watching!
@akashkarve1991
@akashkarve1991 4 года назад
Awesome!!! video. Very easy to understand and explained it very well. Looking forward more videos on Mass Transit & RabbitMQ. Best thing I liked about this video is that you have explained it in both ways normal as well as with extension methods which helps to understand things in better way. Keep it up mate. Appreciate your work. Thanks!!!
@DotNetCoreCentral
@DotNetCoreCentral 4 года назад
@aakash karve, thanks for watching the video!
@kysondarren460
@kysondarren460 3 года назад
you prolly dont give a damn but does anybody know a trick to get back into an Instagram account..? I was stupid lost the account password. I would love any tricks you can give me!
@lyricmathew8077
@lyricmathew8077 3 года назад
@Kyson Darren Instablaster :)
@kysondarren460
@kysondarren460 3 года назад
@Lyric Mathew I really appreciate your reply. I found the site on google and im waiting for the hacking stuff atm. Looks like it's gonna take a while so I will get back to you later with my results.
@kysondarren460
@kysondarren460 3 года назад
@Lyric Mathew It worked and I now got access to my account again. I am so happy! Thank you so much, you really help me out :D
@alirashidi795
@alirashidi795 2 года назад
Thank you It was the best example out there in internet
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
Thank you!
@JohnDoe-xi6df
@JohnDoe-xi6df 2 года назад
Based on the example from this video, I couldn't understand the benefit of using MassTransit. If I understand correctly, one service published a message and the other one consumed it. Isn't that what RabbitMQ does? What did we get by using MassTransit here?
@avtarsashia4897
@avtarsashia4897 2 года назад
Concept cleared. Its good tutorial to understand from basics
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
Thanks!
@jeganathperialwar7788
@jeganathperialwar7788 2 года назад
Explained well. Thanks for the wonderful lecture.
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
Thanks for watching!
@Acesteef
@Acesteef Год назад
How would i use this if the two services cannot share the same namespace and cannot have a reference to the same Order model? I implemented this into both my microservices but they are both in a different namespace. Right now it is not sending or receiving any messages in RMQ.
@oguzsisman9851
@oguzsisman9851 2 года назад
Thank you mate, very helpful
@ЯковЯсько-ф4п
@ЯковЯсько-ф4п 2 года назад
You help me a lot, I like the video and I will be your subscriber
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
Thanks for watching!
@lalpj4856
@lalpj4856 2 года назад
Thank you😀
@christophertanghare4884
@christophertanghare4884 4 года назад
I would like to see your video on saga pattern, I am watching for it 😁
@DotNetCoreCentral
@DotNetCoreCentral 4 года назад
@Christopher Tanghare, thanks! Hopefully this weekend.
@SuperSagar55
@SuperSagar55 3 года назад
Thank you, Can you create a video on Distributed transaction with saga orch. pattern.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Sagar Khairnar, thanks for watching! I will definitely do a video on the Orchestration saga pattern.
@mahendranchinnaiah7593
@mahendranchinnaiah7593 4 года назад
Great effort. Thank you so much
@DotNetCoreCentral
@DotNetCoreCentral 4 года назад
@Mahendran Chinnaiah, thanks for watching as always! Appreciate your support.
@mahendranchinnaiah7593
@mahendranchinnaiah7593 4 года назад
@@DotNetCoreCentral am a big fan of your videos also eagerly waiting for your videos at Sunday 7pm cst
@DotNetCoreCentral
@DotNetCoreCentral 4 года назад
@@mahendranchinnaiah7593 thanks!
@lismai9906
@lismai9906 3 года назад
Why your publisher app's Configure(x) is using "temp-queue" but in your Consumer app, u r using "order-queue", isnt that gonna be an issue catching the message ?
@user-rp9iis1en6h
@user-rp9iis1en6h 3 года назад
Excellent tutorial. What if I deploy 2 consumers and in the queue there are many requests. Is there any chance that both consumers will pick the same message and create a conflict?
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@S. Z., no it will never get the same message for 2 consumers for the same queue. And that's not a feature of Masstransit, it is how RabbitMQ or other underlying queuing engine works.
@user-rp9iis1en6h
@user-rp9iis1en6h 3 года назад
@@DotNetCoreCentral in that case how multiple consumer will perform together? Suppose I have a queue called OrderPlaced. And there is two consumer, 1. PrepareDelivery 2. PrepareReceipt Whenever there is a item in order queue, these two consumer need to start their work. How this can be achieved with rabbitMq without using another new queue ?
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@user-rp9iis1en6h ​ for that each consumer have to have their dedicated queue, and connected from an exchange. I have covered this scenario in my RabbitMQ series.
@user-rp9iis1en6h
@user-rp9iis1en6h 3 года назад
@@DotNetCoreCentral Yes I have already seen them but couldn't understand how to configure exchange using massTransit.
@Gimmiyimmy
@Gimmiyimmy 4 года назад
Thank you. Very well explained
@DotNetCoreCentral
@DotNetCoreCentral 4 года назад
@Atul Srivastava, thanks for watching!
@shamilgurban6439
@shamilgurban6439 3 года назад
Thanks for great tutorial. But i have a question. My models are seperated in different projects so i should create models in two places. How can i bind exchanges so exchange from one project can find exchange from another project. They have different namings by default :(
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Shamil Gurban, I am not sure I understand the question. Exchanges are used to publish messages, so any project can bind to the exchange to publish messages. If you are subscribing to an exchange, the same holds true, you can subscribe from any project. The filename does not matter for the data model, as long as both have the same property name when they are serialized in JSON.
@lismai9906
@lismai9906 3 года назад
As long as your Contract class has the SAME NAMESPACE, it will trigger Consume(x) method. So ask your other dev for his namespace used in his "Order" class
@Gimmiyimmy
@Gimmiyimmy 3 года назад
I need to create topic exchange but don't know the syntex. Where I can find example and tutorials for this.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Atul Srivastava, thanks for watching! You can do something like this: Host.ConnectReceiveEndpoint(yourqueue, x => { x.BindMessageExchanges = false; x.Consumer(); x.Bind(e => { e.RoutingKey = yourroutingkey; e.ExchangeType = ExchangeType.Topic; }); });
@Gimmiyimmy
@Gimmiyimmy 3 года назад
Thank you so much. 🙏🙏
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@Gimmiyimmy you are welcome sir!
@Gimmiyimmy
@Gimmiyimmy 3 года назад
@@DotNetCoreCentral Sir, Please don't call me sir. I am nothing in front of you. 😒
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@Gimmiyimmy we are all developers my friend, we all the same :)
@codewithkashif
@codewithkashif 3 года назад
I am still not able to figure out that what is the exact benefit of using mass transit...all these things we can do with rabbitmq without using this masstransit too...because adding also add extra complexity and required learning curve. So there must be something where it is making major impact....kindly help
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Kashif Reza, MassTransit by default implements the pattern of Exchange -> Queue, which mostly needs a thorough understanding to do it the right way. So that is one of the advantages. The other advantage, which I did not cover in my video yet is the ability to simplify the distributed transactions, which I intend to cover in future videos.
@codewithkashif
@codewithkashif 3 года назад
​@@DotNetCoreCentral Thanks a lot for detailed answer! distributed transaction means, Does it helps in implementing SAGA? I heard it also helps in implementing Outbox pattern..please lemme know if you have any plan to post any video around that. also last question i.e. Is MassTransit also available for classic .net framework?
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@codewithkashif yes, by distributed transaction I mean the implementation of SAGA. I have a plan to do a video in the future on this. MassTransit works with classic .NET Framework also as I recollect.
@jelajahpasundanofficial
@jelajahpasundanofficial 3 года назад
Wow.. awesome. thank you dude. thank you so much
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@risman afyandi, thanks for watching!
@andreicapi3535
@andreicapi3535 3 года назад
Thank you
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@andrei capi, thanks for watching!
@sridharsathya8719
@sridharsathya8719 2 года назад
Thanks.
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@Sridhar Sathya, thanks for watching!
@kwiatu5
@kwiatu5 Год назад
JSON, is that you?
@xxXAsuraXxx
@xxXAsuraXxx 2 года назад
whats your preference between MassTransit and EasyNetQ?
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@Kevin Wang, to be honest, MassTransit is a little advance and is very useful for managing complex workflow because it makes those easier. But if you have a very simple workflow, I will just use the default RabbitMQ client. I personally have never used EasyNetQ
@xxXAsuraXxx
@xxXAsuraXxx 2 года назад
Thank for the reply, does the masstransit saga only works only if you use their messaging api but not regular CQRS? I am still confused how their saga work and how does it work with dapper.
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@@xxXAsuraXxx I have not used it yet, and the reason I have not used Masstransit with Saga because I like to keep more control of the code on my side instead of external packages where it makes sense. Saga is simple enough to do it yourself without using any framework, IMO.
Далее
КТО БОИТСЯ КЛОУНОВ?? #shorts
00:20
Просмотров 521 тыс.
Brutally honest advice for new .NET Web Developers
7:19
MassTransit - Getting Started with RabbitMQ
10:10
Просмотров 28 тыс.
Intro To RabbitMQ
54:06
Просмотров 103 тыс.
КТО БОИТСЯ КЛОУНОВ?? #shorts
00:20
Просмотров 521 тыс.