Building Reactive Microservice with RabbitMQ and ASP.NET Core

Поделиться
HTML-код
  • Опубликовано: 2 фев 2025
  • НаукаНаука

Комментарии • 78

  • @rsodeyi
    @rsodeyi 3 года назад

    I love that the picture is painted immediately in the first 2 mins - thank you

    • @DotNetCoreCentral
      @DotNetCoreCentral  3 года назад

      @Roland the Bajan Naija Londoner, thanks for watching!

  • @codewithkashif
    @codewithkashif 4 года назад +3

    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.. :)

  • @sudhiranand5179
    @sudhiranand5179 2 года назад

    Thanks, in first 60 seconds itself, I understood clearly. Really Good explanation.

  • @nurlanavazzade8887
    @nurlanavazzade8887 6 месяцев назад

    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

  • @nikneumann1752
    @nikneumann1752 Год назад

    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.

  • @ganeshshrestha1384
    @ganeshshrestha1384 Год назад

    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?

  • @pinkeshpatel1940
    @pinkeshpatel1940 2 года назад

    Awesome tutorial, 00:19:35 How did you change const property naming conventions?

  • @mahmoudalaskalany
    @mahmoudalaskalany 3 года назад

    why am so late to get this channel ..
    thanks man and keep up the great content

  • @eliassal1
    @eliassal1 4 года назад

    Really, great and useful talk and demo

  • @Gimmiyimmy
    @Gimmiyimmy 4 года назад

    Geart. Nice tutorial. A big salute to you.

  • @RAM-ff8dy
    @RAM-ff8dy 4 года назад

    Good Job, You always provides the great useful content...

  • @antarikshverma8999
    @antarikshverma8999 4 года назад

    Thank you for clear explanation.

  • @libegato
    @libegato 3 года назад

    Thanks for the content, mate!!

  • @sniperwolfpk5
    @sniperwolfpk5 2 года назад

    Brilliant

  • @seideldaniel
    @seideldaniel 3 года назад

    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?

    • @DotNetCoreCentral
      @DotNetCoreCentral  3 года назад +1

      @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.

  • @codewithkashif
    @codewithkashif 2 года назад

    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?

    • @MiningForPies
      @MiningForPies Год назад

      Asynchronous methods and asynchronous communications are totally separate concepts

  • @ekreactapp1370
    @ekreactapp1370 3 года назад +1

    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

    • @DotNetCoreCentral
      @DotNetCoreCentral  3 года назад +1

      @ekreact app, thanks for watching! Sure I will do it in one of the future videos.

  • @mahendranchinnaiah7593
    @mahendranchinnaiah7593 4 года назад

    Great job.Appreciate your effort..

  • @joycalcutta
    @joycalcutta 4 года назад +2

    Good videos, please try to zoom in when you're coding and try to cover the filename as well, it helps. Good stuff!

    • @DotNetCoreCentral
      @DotNetCoreCentral  4 года назад +1

      @Aritra Ghosh, thanks for watching! And thanks for your suggestion.

  • @manuelguerrero9917
    @manuelguerrero9917 4 года назад

    Excellent video, waiting for the resiliency of message publishing with masstransit you talked about in minute 9:38 : )

    • @DotNetCoreCentral
      @DotNetCoreCentral  4 года назад +1

      @Manuel Guerrero, thanks for watching! Yes, I will try to do that within the next few weeks.

  • @sovannseung6985
    @sovannseung6985 3 года назад

    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.

    • @DotNetCoreCentral
      @DotNetCoreCentral  3 года назад +1

      @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.

    • @sovannseung6985
      @sovannseung6985 3 года назад

      @@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.

    • @DotNetCoreCentral
      @DotNetCoreCentral  3 года назад +1

      @@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.

    • @sovannseung6985
      @sovannseung6985 3 года назад

      @@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.

    • @DotNetCoreCentral
      @DotNetCoreCentral  3 года назад +1

      @@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.

  • @SubrataDas-xn8qj
    @SubrataDas-xn8qj 2 года назад

    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
      @DotNetCoreCentral  2 года назад

      Thanks for watching and for the great feedback. I will be sure to keep this in mind in the future.

  • @eliassal1
    @eliassal1 4 года назад

    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

    • @DotNetCoreCentral
      @DotNetCoreCentral  4 года назад

      @Salam Elias, yes, we should. I will upload the DB scripts today.

    • @eliassal1
      @eliassal1 4 года назад

      @@DotNetCoreCentral thanks

    • @DotNetCoreCentral
      @DotNetCoreCentral  4 года назад

      @@eliassal1 you got it!

    • @eliassal1
      @eliassal1 4 года назад

      @@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

    • @eliassal1
      @eliassal1 4 года назад

      @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

  • @AmitChauhan-rq2ku
    @AmitChauhan-rq2ku 3 года назад

    really awesome ! thanks for making this video . can you make some video to implement Redis Cache in .net core microservice

  • @finki007
    @finki007 4 года назад

    why are you not specifiy the queue for the publisher?

    • @DotNetCoreCentral
      @DotNetCoreCentral  4 года назад +1

      @Alexander Finkbeiner, based on the Exchange-Queue design pattern, you don't specify queue during publishing, it is always published to an exchange.

    • @finki007
      @finki007 4 года назад

      @@DotNetCoreCentral Thanks!

    • @DotNetCoreCentral
      @DotNetCoreCentral  4 года назад

      @@finki007 you are welcome!

  • @SuperSagar55
    @SuperSagar55 4 года назад

    Very Useful. Can you please create on masstransit micro service with api gateway.

    • @DotNetCoreCentral
      @DotNetCoreCentral  4 года назад +1

      @Sagar Khairnar, the comment is very timely, I am working on MassTransit series now. You will see those soon. Thanks

    • @p2pdelivery40
      @p2pdelivery40 4 года назад

      @@DotNetCoreCentral Waiting for it....

    • @DotNetCoreCentral
      @DotNetCoreCentral  4 года назад

      @@p2pdelivery40 thanks!

  • @اسيرالعلم-ك9ظ
    @اسيرالعلم-ك9ظ 8 месяцев назад

    I think Masstransient library makes messing easier

  • @priyanshu4016
    @priyanshu4016 3 года назад

    please order the videos in proper order in playlist

    • @DotNetCoreCentral
      @DotNetCoreCentral  3 года назад +1

      @Web Samurai, thanks for watching the video, I will surely do.

  • @davitbujiashvili1936
    @davitbujiashvili1936 3 года назад

    ჯობი რად გინდა მანდ ?

  • @muhammadkhoirudin1511
    @muhammadkhoirudin1511 2 года назад

    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