Firstly thanks a lot for this great content. Probably you even don't remember it. But why did you use hosted service for subscription? What is the importance of it
When writing the post method, what do you mean with using retry or other mechanism? We have the message broker to solve the same problem! There should be another consumer that saves the data in DB.
Good one. One thing I noticed, the Subscriber.Subscribe() method does not seem to await. Therefore, even though it is in the IHosted service inside the start method, it will only be able to get the data during the start. If you post message to queue it wont be able to get it unless the service is refreshed or restarted. Is that correct?
Thanks for the great content. Is it possible that the HostedService is listening to more the than one subscriber? I can add multiple ISubscribers in the startup but how do I pass these into the HostedService?
@Daniel S, yes you can. There are a couple of ways to do it, you can either have a delegate as a dependency, and the delegate can return you the array of subscriptions, or you can register an array and have the IHosterService implementation take an array as a dependency.
It is often said that Event Driven architecture helps in asynchronous communication. While in Request-Driven architecture - API calls are synchronous and it needs to keep waiting until response comes from server. So I have a question that C# "async Task" apis aren't asynchronous apis? Isn't that solving that synchronous api call problem?
Great video, can you please cover, how to debug Reactive Micro-services, since they don’t read directly from end-points, its bit tricky and complex I believe
Awesome video. Anyway, I have a question. In this video, for publisher you call a POST rest api then publish it to message queue then consumer in report will consume it and add it to memory storage (Dictionary). I am wondering what if we call a POST in rest api then we are waiting some result to get back, could we use RabbitMQ in this scenario? For example: in order service, we call POST rest api then we want to add it to memory storage and other than that we also want some result to get back and return it to the user. For example, it will return order number, status of order, estimate arrival date,.... How to handle this scenario? Thank you in advance.
@Sovann Seung, thanks for watching! The answer is you can, but it is not the right purpose of RabbitMQ. The idea of introducing a queue is to be able to scale up and down processing based on load. In these scenarios, ideally, the service will put a message in the queue and will return back to the user with a processing status, and the caller will call later to see if the processing is done or not. Let me know if it makes sense.
@@DotNetCoreCentral Thank you for your answer. I am new to RabbitMQ. After watching your video (Part1, 2, 3), I got some concept of the RabbitMQ. I am still not clear about my concern above. Let say in Rest Api POST product (Add new product), we will publish to Queue, and there are many process happen under the hood. For example: 1. Add product to database, 2. Send email notification, 3. Updating stock and 4. Write log history. These 4 processes combine together take around 1 minute to completed. Let say the user hit Add new product button which is call Rest Api POST product, will the user need to wait during that time? Or we ask the user to come back and check later? Any message we should get back to the user during process happening in the background? This question maybe a little weird since I am new to RabbitMQ, but I just wondering about the concept. Thank you.
@@sovannseung6985 your question is very valid. In your situation, if I have to design this, then based on business requirement, I will probably save the data into the database as part of the service itself, and use RabbitMQ and the consumers to do post-processing, like writing to log history, send email notification and update the stock information. That way the product is available in a database, and you can send a proper acknowledgment to the user about successful product entry, whereas the other tasks which are not time-sensitive can happen in the background.
@@DotNetCoreCentral Thank you for your answer. One last question, let assume we follow your solution above. While post-processing like writing to log history, send email notification and update the stock information are happening in the background (Consumer is working on it ), does the POST method product stop running or still running? Thank.
@@sovannseung6985 POST product returns immediately after updating the database and sending a message to the queue, its job is done there. The queue consumers will get messages in their respective queues and will continue their processing. At this point, the queue processors are completely disconnected from the POST, and the POST does not have to wait for them to finish.
Very informative video however it'll be better if at the beginning you put a diagram of all the participating components and every time you refer back to it while explaining.Keep up the good work!!!
@@DotNetCoreCentral Yes, I got it. I reached minute 15:40, what you are coding does not resemble the github version, in the OrderController.cs, you have only publsher.publish......"report.order", in startup.cs, I have completely different things. Is the version you are working on in the video is not the same one? Thanks
@DotNet Core Central In other words, where is the source code of the monolithic ecom app so I can follow the video "Converting a Monolithic Application into Microservices in ASP.NET Core", and then this one, I would like to follow the exact same steps as I appreciate your methodology
public Task StartAsync(CancellationToken cancellationToken) { _subscriber.SubscribeAsync(ConsumeFoodData); return Task.CompletedTask; } Hi, ahead of time I'd like to say thank you. I have one question, if I use SubscribeAsync, should I use await inside this method? Because, by using SubscribeAsync unable to debug Consumer method callback
I love that the picture is painted immediately in the first 2 mins - thank you
@Roland the Bajan Naija Londoner, thanks for watching!
Awesome work man!
I am bit new to your channel and after watching your several videos, I regret why did I came so late here.. :)
@Kashif Reza, thanks for much for watching!
Thanks, in first 60 seconds itself, I understood clearly. Really Good explanation.
Thanks for watching!
Firstly thanks a lot for this great content. Probably you even don't remember it. But why did you use hosted service for subscription? What is the importance of it
When writing the post method, what do you mean with using retry or other mechanism? We have the message broker to solve the same problem!
There should be another consumer that saves the data in DB.
Good one. One thing I noticed, the Subscriber.Subscribe() method does not seem to await. Therefore, even though it is in the IHosted service inside the start method, it will only be able to get the data during the start. If you post message to queue it wont be able to get it unless the service is refreshed or restarted. Is that correct?
Awesome tutorial, 00:19:35 How did you change const property naming conventions?
why am so late to get this channel ..
thanks man and keep up the great content
@mahmoud alaskalany, thanks for watching!
Really, great and useful talk and demo
@Salam Elias, thanks!
Geart. Nice tutorial. A big salute to you.
@Atul Srivastava, thanks for watching!
Good Job, You always provides the great useful content...
@RAM, thanks for watching!
Thank you for clear explanation.
@Antariksh verma, thanks for watching!
Thanks for the content, mate!!
@Renan Liberato, thanks for watching!
Brilliant
Thanks!
Thanks for the great content.
Is it possible that the HostedService is listening to more the than one subscriber? I can add multiple ISubscribers in the startup but how do I pass these into the HostedService?
@Daniel S, yes you can. There are a couple of ways to do it, you can either have a delegate as a dependency, and the delegate can return you the array of subscriptions, or you can register an array and have the IHosterService implementation take an array as a dependency.
It is often said that Event Driven architecture helps in asynchronous communication.
While in Request-Driven architecture - API calls are synchronous and it needs to keep waiting until response comes from server.
So I have a question that C# "async Task" apis aren't asynchronous apis? Isn't that solving that synchronous api call problem?
Asynchronous methods and asynchronous communications are totally separate concepts
Great video, can you please cover, how to debug Reactive Micro-services, since they don’t read directly from end-points, its bit tricky and complex I believe
@ekreact app, thanks for watching! Sure I will do it in one of the future videos.
Great job.Appreciate your effort..
@Mahendran Chinnaiah, thanks for watching!
Good videos, please try to zoom in when you're coding and try to cover the filename as well, it helps. Good stuff!
@Aritra Ghosh, thanks for watching! And thanks for your suggestion.
Excellent video, waiting for the resiliency of message publishing with masstransit you talked about in minute 9:38 : )
@Manuel Guerrero, thanks for watching! Yes, I will try to do that within the next few weeks.
Awesome video. Anyway, I have a question. In this video, for publisher you call a POST rest api then publish it to message queue then consumer in report will consume it and add it to memory storage (Dictionary). I am wondering what if we call a POST in rest api then we are waiting some result to get back, could we use RabbitMQ in this scenario? For example: in order service, we call POST rest api then we want to add it to memory storage and other than that we also want some result to get back and return it to the user. For example, it will return order number, status of order, estimate arrival date,.... How to handle this scenario? Thank you in advance.
@Sovann Seung, thanks for watching!
The answer is you can, but it is not the right purpose of RabbitMQ. The idea of introducing a queue is to be able to scale up and down processing based on load. In these scenarios, ideally, the service will put a message in the queue and will return back to the user with a processing status, and the caller will call later to see if the processing is done or not.
Let me know if it makes sense.
@@DotNetCoreCentral Thank you for your answer. I am new to RabbitMQ. After watching your video (Part1, 2, 3), I got some concept of the RabbitMQ. I am still not clear about my concern above. Let say in Rest Api POST product (Add new product), we will publish to Queue, and there are many process happen under the hood. For example: 1. Add product to database, 2. Send email notification, 3. Updating stock and 4. Write log history. These 4 processes combine together take around 1 minute to completed. Let say the user hit Add new product button which is call Rest Api POST product, will the user need to wait during that time? Or we ask the user to come back and check later? Any message we should get back to the user during process happening in the background? This question maybe a little weird since I am new to RabbitMQ, but I just wondering about the concept. Thank you.
@@sovannseung6985 your question is very valid.
In your situation, if I have to design this, then based on business requirement, I will probably save the data into the database as part of the service itself, and use RabbitMQ and the consumers to do post-processing, like writing to log history, send email notification and update the stock information. That way the product is available in a database, and you can send a proper acknowledgment to the user about successful product entry, whereas the other tasks which are not time-sensitive can happen in the background.
@@DotNetCoreCentral Thank you for your answer. One last question, let assume we follow your solution above. While post-processing like writing to log history, send email notification and update the stock information are happening in the background (Consumer is working on it ), does the POST method product stop running or still running? Thank.
@@sovannseung6985 POST product returns immediately after updating the database and sending a message to the queue, its job is done there. The queue consumers will get messages in their respective queues and will continue their processing. At this point, the queue processors are completely disconnected from the POST, and the POST does not have to wait for them to finish.
Very informative video however it'll be better if at the beginning you put a diagram of all the participating components and every time you refer back to it while explaining.Keep up the good work!!!
Thanks for watching and for the great feedback. I will be sure to keep this in mind in the future.
HI, should we have the DB created before running the app? If yes, can you please provide the sql script as it is not on the github repo
@Salam Elias, yes, we should. I will upload the DB scripts today.
@@DotNetCoreCentral thanks
@@eliassal1 you got it!
@@DotNetCoreCentral Yes, I got it. I reached minute 15:40, what you are coding does not resemble the github version, in the OrderController.cs, you have only publsher.publish......"report.order", in startup.cs, I have completely different things. Is the version you are working on in the video is not the same one? Thanks
@DotNet Core Central In other words, where is the source code of the monolithic ecom app so I can follow the video "Converting a Monolithic Application into Microservices in ASP.NET Core", and then this one, I would like to follow the exact same steps as I appreciate your methodology
really awesome ! thanks for making this video . can you make some video to implement Redis Cache in .net core microservice
@Amit Chauhan, thanks for watching! Sure I will
why are you not specifiy the queue for the publisher?
@Alexander Finkbeiner, based on the Exchange-Queue design pattern, you don't specify queue during publishing, it is always published to an exchange.
@@DotNetCoreCentral Thanks!
@@finki007 you are welcome!
Very Useful. Can you please create on masstransit micro service with api gateway.
@Sagar Khairnar, the comment is very timely, I am working on MassTransit series now. You will see those soon. Thanks
@@DotNetCoreCentral Waiting for it....
@@p2pdelivery40 thanks!
I think Masstransient library makes messing easier
please order the videos in proper order in playlist
@Web Samurai, thanks for watching the video, I will surely do.
ჯობი რად გინდა მანდ ?
public Task StartAsync(CancellationToken cancellationToken)
{
_subscriber.SubscribeAsync(ConsumeFoodData);
return Task.CompletedTask;
}
Hi, ahead of time I'd like to say thank you. I have one question, if I use SubscribeAsync, should I use await inside this method? Because, by using SubscribeAsync unable to debug Consumer method callback