Тёмный

RabbitMQ in .NET Core (Part 1, Single producer and consumer with Queue) 

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

This is the first video of the video series on RabbitMQ. RabbitMQ is vast, and it is not possible to cover every single aspect of RabbitMQ in a single video. Hence, I will create a series of RabbitMQ.
Before we get into RabbitMQ it is important to understand why we need a queueing system. And I discussed this in my video on Microservices here:
Microservices introduction: • What are Microservices...
Hands-on microservices: • Converting a Monolithi...
A queue or a message broker provides the much-needed decoupling between microservices. And it prevents get into the anti-pattern of the distributed monolith.
You can think of a message broker like a post office. Its main responsibility is to broker messages between publishers and subscribers.
Once a message is received by a message broker from a producer, it routes the message to a subscriber. The message broker pattern is one of the most useful patterns when it comes to decoupling microservices.
The source code for this video is available in my GitHub repo here: github.com/choudhurynirjhar/r...

Наука

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

 

12 сен 2020

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 158   
@theghumketu2367
@theghumketu2367 2 года назад
Wohoo it just took 20 minutes to learn something valuable today. Thank you
@charlesmcnicoll9060
@charlesmcnicoll9060 3 года назад
Great stuff and great teaching! Everything worked as is on my computer. I especially enjoyed the painless installation of RabbitMQ using Docker, so easy! You have a new subscriber, thanks a lot!
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Charles McNicoll, thanks for watching! Yes, using docker to install makes life so much easier. Though in a production environment if you are using docker and want to keep durable messages, then it might become a little complex. In production, I use AWS Managed RabbitMQ and it's super simple as well.
@peymanGhaderkurehpaz
@peymanGhaderkurehpaz 3 года назад
Thanks bro , this series is going to be awesome. Micorservices are really in trend and it's great to make a series about how to design microservices. ❤👌
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@peyman Ghkp, thanks!
@antarikshverma8999
@antarikshverma8999 3 года назад
Perfactly demonstration of exchange concepts , Thank you. Your channel is now my favorite channel for dotnet core learning.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Antariksh verma, thanks for watching!
@tzadiko
@tzadiko 3 года назад
Actually this video did NOT discuss exchanges at all. That is another video. This video is queues only.
@pasdilhan
@pasdilhan 2 года назад
Short and sweet but covered necessary basics.. Thanks
@ericngo2228
@ericngo2228 3 года назад
Simple and straightforward. Excellent tutorial for beginners, who want to use RabbitMQ for inter process communication. It saves a lot of money in compare with using Azure Service Bus.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Eric Ngo, thanks for watching!
@RAM-ff8dy
@RAM-ff8dy 3 года назад
Super informative, looking forward for next RabbitMq series, try to post them ASAp..
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@RAM, thanks for watching!
@mrohailiqbal
@mrohailiqbal Год назад
Really great stuff. Nicely explained. Keep it up bro
@vittoriomorellini1939
@vittoriomorellini1939 Год назад
Perfect explanation BASIC to understand rabbitmq and its use in microservices
@DotNetCoreCentral
@DotNetCoreCentral Год назад
Thanks!
@krishnakishore2889
@krishnakishore2889 2 года назад
so simple and the best video so far I have seen in you tube on c# communicating with Rabbit MQ
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@Krishna Kishore, thanks for watching!
2 года назад
Thank you for your short, concise and clear explanation
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
Thanks!
@vincent4624
@vincent4624 3 года назад
Very nice tutorial. Starting out with the very basics of RabbitMQ. Just what I needed! I'll definatly be following this series :)
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Vincent, thanks for watching!
@thethomasproject
@thethomasproject 2 года назад
Agreed with other comments. Not too little or not too much as an intro. And I got to build a quick project (though I didn't get it all), to see it working. Great intro!!
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@Frank Thomas, thanks for watching!
@varunsharma10286
@varunsharma10286 3 года назад
Great video, It was Valuable and Informative.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@varun sharma, thanks for watching!
@aparnadevi7040
@aparnadevi7040 2 года назад
Awesome explanation. Very easy to understand.
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@aparna devi, thanks!
@idog63
@idog63 2 года назад
excellent video. very clear and easy to follow. 👍
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@idog63, thanks for watching!
@ankitjindal6050
@ankitjindal6050 2 года назад
Very well explained and demoed. Thanks!
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@Ankit Jindal, thanks for watching!
@sanjeevgaur1973
@sanjeevgaur1973 23 дня назад
Simply WOW 👍
@hazlotumismo1419
@hazlotumismo1419 3 года назад
Very cool video, thank you for sharing Sir!
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Hazlo tu mismo!, thanks for watching!
@MarioStaats
@MarioStaats 3 года назад
Great tutorial, directly subscribed :-)
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Mario Staats, thanks for watching!
@bashirmanafikhi
@bashirmanafikhi Год назад
great, I watched a lot of lessons, but you are the best
@DotNetCoreCentral
@DotNetCoreCentral Год назад
Thanks!
@olufemioyedepo2791
@olufemioyedepo2791 3 года назад
nice video on rabbitmq, keep them coming...
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Olufemi Oyedepo, thanks for watching!
@olufemioyedepo2791
@olufemioyedepo2791 3 года назад
@@DotNetCoreCentral you're welcome. Your video on background jobs using Hangfire was 👌🏾. I became a subscriber since then.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@olufemioyedepo2791 thank you!
@salarkazazi7584
@salarkazazi7584 Год назад
Thank to so much, great start !
@zakiit9594
@zakiit9594 3 года назад
Thx again, would love it if you cover more on the admin screen!
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@zaki it, I will try to do a video in the future. Thanks!
@bnks2011
@bnks2011 2 года назад
Excellent explanation.. Thanks
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
Thanks for watching!
@Moosa_Says
@Moosa_Says Год назад
Perfect! Thanks :)
@DotNetCoreCentral
@DotNetCoreCentral Год назад
Thanks for watching!
@tehseenakhtar3209
@tehseenakhtar3209 Год назад
good basics of producer and consumer. kindly add the chapters ( instead of key moments) in the video that helps a lot in segmentaion of video. like 14:02 Create a Consumer. Add the chapters in description
@DotNetCoreCentral
@DotNetCoreCentral Год назад
Thanks for the suggestion! And thanks for watching!
@sivakumarr28
@sivakumarr28 3 года назад
Great demo. Keep it up..
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Sivakumar R, thanks!
@rahulmathew8713
@rahulmathew8713 3 года назад
Awesome job
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Rahul Mathew, thanks for watching!
@shreeK-27
@shreeK-27 Год назад
Great tutorial. 👍👍
@DotNetCoreCentral
@DotNetCoreCentral Год назад
Thanks for watching!
@semen083
@semen083 Год назад
Hi, it is any way to make a receiver without blocking thread (Console.Readline at 17:28)? For example I need to create multiple subscribers in one application without console?
@giorgiocipriano3334
@giorgiocipriano3334 2 года назад
I have an error with the consumer, can I see the message in the rabitmq console only with th producer?
@saisivakrishnagarimella8534
@saisivakrishnagarimella8534 2 года назад
Hi, any minimum publish time for message? I am getting timeout, if publishing time more than 20sec. please let me know, Thank you in Advance
@mukeshtrivedi1896
@mukeshtrivedi1896 3 года назад
very informative vedio,can you make for multiple consumer along with circuitbreaker and poly
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Mukesh Trivedi, thanks for watching. I can surely try that.
@santoshkumaryadav4436
@santoshkumaryadav4436 Год назад
Thanks for this great video, Can you please make some videos on Azure
@zeeshanasghar3751
@zeeshanasghar3751 3 года назад
just a suggestion your video "Microservice resilience - Circuit Breaker using polly in .Net Core " should be part of this series ?
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Zeeshan Asghar, yes, it is part of Microservices. I might have not put it in the playlist, I will do that. Thanks for pointing it out.
@zakiit9594
@zakiit9594 3 года назад
Thanks a bunch
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@zaki it, thanks for watching!
@odinsrensen7460
@odinsrensen7460 2 года назад
That worked, thanks.
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@Odin Sørensen, thanks for watching!
@amnesia3490
@amnesia3490 3 года назад
What I don't understand is, in the consumer, it's an console app, that means when you run it once, it compile and process up to the Console.Readline(), and it stops... So how is that happening when you run producer again and can see the result in consumer ? Consumer is an console app already compiled and executed to the Console.Readline()... Is it using something like websockert ? How it will behave on web api on production ?
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@AmnesiA, in this example, Console.ReadLine is a blocking call and it makes the application wait for a user input, which means until unless a character is entered from the keyboard. But in a production application, you will probably use something like an IHostedService interface implementation to manage this, so that the consumer never shuts down.
@maneeshdeepankar2984
@maneeshdeepankar2984 3 месяца назад
great
@RohitSingh-go4ng
@RohitSingh-go4ng 2 месяца назад
Rabbit MQ it is always send byte format it is possible to consume in the json format
@eliassal1
@eliassal1 3 года назад
Nice, useful and easy to understnad. A couple of questions, what "Durable false or true" flag means for RabbitMQ, 2nd, when messages are consumed they disappear from queue, how for example if during the day Rabbit receives 1000 messages and I, from admin perspective can see what happened and details of each message in the dashboard? I activated Recent-history plugin but still can't see the history of messages, thanks again
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Salam Elias, the "Durable" flag is used to indicating the RabbitMQ to persist the metadata of the Queue and its in-flight messages to the disk so that it can recover a restart. Regarding tracing messages coming to RabbitMQ, I used a combination of out of box RabbitMQ logs and Application logs, for all debugging/tracing purposes. These logs are shipped to AWS Cloudwatch and we do our analysis there. I have not used the Admin site for detailed log analysis. I have used the Admin site mainly to monitor the general health of the exchanges, connections, queues, and nodes.
@eliassal1
@eliassal1 3 года назад
@@DotNetCoreCentral Thanks for your reply. I used Biztalk server heavily in different Publish-Subscribe scenarios, inside of it, you can see all what happened according to a time period you configure. I think it is a little bit heavy nad needs a lot of efforts to use different tools to do admin stuff. I beleive that RabbitMQ is a good tool but it needs to improve its admin features
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@eliassal1 got it.
@primavera919
@primavera919 2 года назад
How did you launch the command line @ 4:41?
@elyeskacem4784
@elyeskacem4784 11 месяцев назад
the command of rabbitMQ : docker run -d --hostname my-rabbit --name ecomm-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management
@triptisharma4731
@triptisharma4731 3 года назад
I want to be able to consume from multiple queues within this single consumer without any of the queues blocking each other. How can we achieve that?
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Tripti Sharma, you can use this Nuget package I created: www.nuget.org/packages/Plain.RabbitMQ/, and source code for this is here: github.com/choudhurynirjhar/plain-rabbitmq. After you use the Nuget, you can create a singleton instance of IConnectionProvider. And multiple instances per consumer for ISubscriber. And each ISubscriber can be used by background tasks: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-1Fe7QD7Ovi8.html, that way they are running in separate threads. That's all is needed. Thanks
@user-bz9qt2tt6k
@user-bz9qt2tt6k 9 месяцев назад
Hi, I am having errors CS8370 Feature "using declaration" is not available in C# 7.3. what's the solution for this?
@videolounge6885
@videolounge6885 6 месяцев назад
can you please write the command here which you used to install the rabbitmq? Also docker image command is not working on my system help me to rectify it.
@aminejadid2702
@aminejadid2702 3 года назад
Thank you. Can you please do a video about Redis Cache and .Net core ?
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@amine jadid, thanks for watching. I have a video on Redis and .Net Core. Here is the link: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qYBaMFHeom8.html
@aminejadid2702
@aminejadid2702 3 года назад
@@DotNetCoreCentral thanks
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@aminejadid2702 Welcome!
@kartheeknandini3767
@kartheeknandini3767 3 года назад
please so more videos on rabbitMQ
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@kartheek nandini, I have other videos for RabbitMQ in this series, have you watched all of them?
@TightyWhities94
@TightyWhities94 2 года назад
beginner here. what's the benefit of the "using" keywords behind connection and challenge?
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@TightyWhities94, the 'using' keyword is used for disposing the connection object, and whichever object it is used with
@mallianumula
@mallianumula 3 года назад
I am new to this, I have a clarification. what is the best approach for client implementation for continues reading, if we do console app, by mistake if someone close the window then, message pulling stop working. so is windows service is better approach or is there any other tools can use as client. make sure client read the message as long as it push into the queue. please advise, thanks
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Malli Anumula, I use Linux for all my application need, so I have never faced this issue recently. And .NET Core does not support Windows Service, for the very reason that it runs both in Linux and windows. You can either run it as a Web application, so you host it in a web server in Windows, or you can run it as a task using Windows task manager.
@mallianumula
@mallianumula 3 года назад
@@DotNetCoreCentral noted, windows task is not an option for me bcz there could be some delay for windows task min is 1min delay to trigger. I will check web option with SignalR .. thanks for update..
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@mallianumula thanks!
@naufilshaikh09
@naufilshaikh09 2 года назад
Perfect start in RabbitMQ but i have frontend application in javascript and backend in dotnet core. how can i setup between them.
@naufilshaikh09
@naufilshaikh09 2 года назад
I mean do i need to setup rabbitmq both side or communicate frontend app and backend app using signalr ?
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@@naufilshaikh09 yes, from backend if you need to send messages real-time to frontend, you will need SignalR for that.
@amitmistry0101
@amitmistry0101 3 года назад
Hi sir, Other then docker, what we used to install RabbitMQ
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@amit mistry, you can install in Windows or Linux box, but that's very complex and time-consuming. This is the URL you can follow: www.rabbitmq.com/install-windows.html
@goforshahriar
@goforshahriar 3 года назад
nice intro, can you go deeper and show it plays important role in developing microservice app?
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Shahriar Hossain, thanks for watching! And yes, that's the goal, first cover all the basics, and then get into a real-life example with microservices.
@antarikshverma8999
@antarikshverma8999 3 года назад
Please try to cover more on management console part.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Antariksh verma, thanks sure I will.
@meganj7155
@meganj7155 2 года назад
If I host this consumer in EKS It is getting exited . Console.readline() is not consider after hosting
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
you cannot use Readline in Linux, its a windows thing. You need to use IHostedService instead. I have a video on the same in my channel, check it out
@meganj7155
@meganj7155 2 года назад
@@DotNetCoreCentral 🙏
@milos5247
@milos5247 2 года назад
Is it a better practice to create queues and exchanges through code or through the management client?
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@Milos Miric, if you want to control access, then it's better to create everything through the management console. But if it's a single app and managed by a single team it's an overhead to manage through the console. In a nutshell, if you need more security, it's better to create everything using the management console and provide specific security access, otherwise, just have single-user access to everything and make queue/exchange from code, you can move much faster and without the management overhead.
@milos5247
@milos5247 2 года назад
@@DotNetCoreCentral Thanks for explaining.
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@@milos5247 you are welcome!
@narendra_ingle
@narendra_ingle 3 года назад
Weblogic jms queue how i can read from there
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Narendra Ingle, you will need to create a bridge, which will read a message from here and post it to WebLogic. There might be some plugins available, but I have never used any.
@nagarazzarazza8405
@nagarazzarazza8405 3 года назад
How do we setup in azure?
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@nagarazza razza, I will do a separate video on that.
@poojanaik5052
@poojanaik5052 2 года назад
How to check msgs stored on docker? Someone help me out pls
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@Pooja Naik, when you say message stored on docker, do you mean message sent to RabbitMQ running inside a docker container? If that is the case you can just use the RabbitMQ management studio to do that.
@DotNetCoreCentral
@DotNetCoreCentral 2 года назад
@Pooja Naik, for accessing the management studio, you will need to open localhost:15672 in your browser
@rfidhari
@rfidhari 3 года назад
Could you please share the URL for next video
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Hari Subbu, thanks for watching this video. Here is the URL for next video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Cm2psU-zN90.html
@dev4g276
@dev4g276 Год назад
Can you please make one video on rabbit mq with mqtt plugin with wrb api please
@DotNetCoreCentral
@DotNetCoreCentral Год назад
I will check it
@dev4g276
@dev4g276 Год назад
@@DotNetCoreCentral sir i will be great full to you thank you
@shreeK-27
@shreeK-27 Год назад
From where do we get the 3 digit of the image? e67?
@DotNetCoreCentral
@DotNetCoreCentral Год назад
You can do docket list, its the first 3 digit of the docker container
@shreeK-27
@shreeK-27 Год назад
@@DotNetCoreCentral ok 👍
@shreeK-27
@shreeK-27 Год назад
@@DotNetCoreCentral when trying to run from the browser getting bad_header and localhost:15672 site can't providebsecure connection error . Why is that happening ?
@DotNetCoreCentral
@DotNetCoreCentral Год назад
@@shreeK-27 I am not sure, I have never seen this error. Its hard to say without seeing exactly what you are doing.
@rabbanishaik2363
@rabbanishaik2363 Год назад
Is it possible to schedule messages?
@DotNetCoreCentral
@DotNetCoreCentral Год назад
Not that straight forward, but can be done through some plugins.
@rabbanishaik2363
@rabbanishaik2363 Год назад
@@DotNetCoreCentral can you please make a simple demo?
@DotNetCoreCentral
@DotNetCoreCentral Год назад
@@rabbanishaik2363 Sure, will do
@rabbanishaik2363
@rabbanishaik2363 Год назад
@@DotNetCoreCentral thank you. Looking forward
@CoderBB
@CoderBB Год назад
Please add all Rabbitmq videos in playlist
@anishachavan8710
@anishachavan8710 3 года назад
I had an error in the Uri
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Anisha Chavan, can you provide a little bit more details on the error?
@anishachavan8710
@anishachavan8710 3 года назад
@@DotNetCoreCentral yes sure
@anishachavan8710
@anishachavan8710 3 года назад
@@DotNetCoreCentral system.argumentexception hresult=0x80070057 message=wrong scheme in amqp uri: ampq source=rabbitmq.client stacktrace: at rabbitmq.client.connectionfactory.seturi(uri uri) at rabbitmq.client.connectionfactory.set_uri(uri value) at rabbitmq.consumer.program.main(string[] args) in c:\users\anisha\source epos abbitmq.consumer abbitmq.consumer\program.cs:line 16 I changed the Uri to :amqp://guest:guest@host:5672/vhost
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@@anishachavan8710 are you creating a new virtual host or you are using the default virtual host? if you are using the default virtual host then your URL should be just "amqp://guest:guest@localhost:5672"
@anishachavan8710
@anishachavan8710 3 года назад
@@DotNetCoreCentral I am using a default virtual host I'll try and let you know
@dharmeshsharma
@dharmeshsharma 3 года назад
This could not help to actual use of micro services. As apis the best way to give examples and understand others to best way. The console is just help the code not best way to use in real world. All the best
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@dharmesh art channel, I did mention in this video that this is a series, where I will first go through the basic concepts of RabbitMQ, and after that, I will create a real-life example of how to use RabbitMQ to create Microservice. And here is the video where I did it: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-rUKqaO8IQCE.html I guess the title caused the confusion, I will change the title of this series.
@june3878
@june3878 Год назад
tired of these "Hello World" examples.
@antarikshverma8999
@antarikshverma8999 3 года назад
Please try to cover more on management console part.
@DotNetCoreCentral
@DotNetCoreCentral 3 года назад
@Antariksh verma, sure, I will schedule it.
Далее
МАРИЯ ГОЛУБКИНА О БАБУШКЕ #shorts
00:43
В GEOMETRY DASH СДЕЛАЛИ GTA
00:27
Просмотров 622 тыс.
Wait for it 😇
00:45
Просмотров 9 млн
.NET 6 - Message Broker with RabbitMQ 🐰🐰🐰
1:00:14
RabbitMQ : Message Queues for beginners
22:06
Просмотров 172 тыс.
Build Clean Messaging in .NET with MassTransit
21:44
Просмотров 95 тыс.
What is RabbitMQ?
10:10
Просмотров 312 тыс.
Deploy a .NET Core API with Docker (Step-by-Step)
36:17
NestJs Microservices with RabbitMQ
23:21
Просмотров 8 тыс.
RabbitMQ Getting Started from DOTNET | Amazon MQ
22:27
Просмотров 2,6 тыс.
Смартфон УЛУЧШАЕТ ЗРЕНИЕ!?
0:41