MassTransit - Getting Started with RabbitMQ

Поділитися
Вставка
  • Опубліковано 9 січ 2025

КОМЕНТАРІ • 19

  • @williamnoel8443
    @williamnoel8443 2 роки тому

    Thank your for this. I really needed a simple, simple walk through to understand how it fit. Very nice.

  • @allannielsen4752
    @allannielsen4752 2 роки тому +1

    Enjoying these getting started videos.

  • @ДмитрийФролов-э3ю
    @ДмитрийФролов-э3ю 11 місяців тому +1

    I've found this video in Getting Started for RabbitMQ. The first half is simple and straightforward except it should be a separate video that explains the concepts behind MassTransit. About RabbitMQ part - I could configure publisher and consumer to connect to RabbitMQ, but I couldn't make it to work because in real case scenario, the publisher and consumer are not in the same solution. In the real world the message type will be different (because namespaces) and therefore exchanges will be different and I spent 2 days in google, stackoverflow and MassTransit docs and couldn't understand how am I supposed to configure this stuff. Every little thing in this lib seems to be different and having a dotnet template doesn't explain anything. Im stuck and feel like I need to study the library whole just to make different services send and accept the messages, because they keep appearing in _skipped queue and I don't know why, MassTransit doesn't emit logs for these cases.
    Then I figured out that yes, MassTransit IS forcing you to either have a nuget package with contracts or use namespace of producer in your project and it's not configurable. Thought deserializer logic could apply here but no.

    • @PhatBoyG
      @PhatBoyG  11 місяців тому

      MassTransit does emit logs, extensive ones, including when messages are skipped. The namespace requirement is clearly pointed out in the documentation, and there are many samples that show contracts in their own assembly.
      masstransit.io/documentation/concepts/messages

    • @ДмитрийФролов-э3ю
      @ДмитрийФролов-э3ю 11 місяців тому

      @@PhatBoyG for my case it only said "bus initialized", no logs about skipping messages. But it was my bad - I haven't set the log level to Debug - but again, in this case it just acknowledges the skip like "SKIP rabbitmq://localhost/CreateUser 70160000-5d73-0015-4e37-08dc1f7e5338", which I have already figured out then when I saw a _skipped queue. It would've pushed me in the right direction if it said why it skips it (type mismatch/exception while handling/filtering or what not) The docs only say that it supports logs, and teaches me how to setup serilog for some reason, like "we like serilog, so here you go", but no friendly reminders or accentuation that one might want to set log level to debug, because our Masstransit mostly logs useful info in debug (even though it is common sense, I know).
      Namespace requirement is pointed out in the documentation, but it's, like, counterintuitive idk.
      1 - Such things are usually displayed in warnings which are yellow, I honestly skipped it probably thinking that it's some pro tip or something)
      2 - every other api communication I've seen didn't force the type name to the fullest - all I needed was the class structure to match. When I found out that it's namespace, I thought " there's a lot of configurations, surely there is a way to make it stop forcing pointless namespace match, like, if I set the queue/exchange names myself, there would be no need to use full type name as key, but seems like no.
      2.5 As searched how to set exchange/queue names, I read more of docs and looked at more config methods in intellisense, and it was too much for me. In config I felt like it's everything in one place, yet i can't find what I need. In docs I felt like it tells me something, but I dont get it with info on 1 subject is spread through different pages with different terminology, and scarce crosslinks.
      And the whole documentation is like that - it's huge, it sure tells a lot, that's good, big thanks that it exists, but it's like it's not written to understand from start to what you need, from basics to rare details and features, you need to study it thoroughly, and use deduction. It's like it's not written for beginners, it's written for those who already know where it's written or has a goal to 100% it.
      Because first thing it does is does everything for you with dotnet template (which is cool that it exists), but if you want an alternative to do that yourself, by learning what you do and why, it just tells you "do that" (right after "install template" like it's not an alternative, but a step - every header of the same level) without explaining anything. AND to do that first thing in the first place it shows you what you're gonna be dealing with - first thing you need is not one of the 3 big buttons, but the small "here" link).
      Then, when you've made something that you don't understand how it works, it throws you to the concepts section. Throws, because it doesn't give an overview in the Overview page. Main concepts are spreadout throughout lengthy pages which contain half the docs, and concepts that you probably won't even need to make a basic understanding (you don't know what are consumers-producers in this project are yet, but already reading about sagas, topology and all headers a message might have)
      Then you are reading about consumers and producers, thinking like they are same-level entities of different types, and wonder why they are made like they are from different libraries, like, why consumer can have a definition class and producer not, etc.
      Then you stumble upon a code snippet that says "to change the topic name used by a message, just do it!" and see a call that doesn't fit anywhere you've written, because you only have a IBusRegistrationConfigurator and can't find Bus.Factory.CreateUsingRabbitMq anywhere.
      And then you look into Test Harness, which has a crosslink to Test Harness (but actually to a Testing concept page). This page explains Start method and that there are Sent/Published/Consumed properties, and the concept page explains that to use them you need a bit more than that. There are GetRequestClient, GetResponse methods, that you don't know what they do, or if you need them. You look at them in intellisense, and they have no xmldocs. You look at entities and try to figure it out, but it's receiving OrderSubmitted in SubmitOrder client :/ The page doesn't reference or cross-link anything (not even an inline comment), but you find that it's probably is RequestResponse thing you don't need, since clearly it's some 2-way communication (you set response in GetResponse). You want to check if publisher sent some messages, but there's nothing related to publishers. Though it is a concept. Search, and realize, there are no publishers, only your class that pushes messages to the bus that are routed by their type config, something you forgot while reading this doc. But then for consumers there is a consumer harness.. I need time to reconnect the dots.
      So, my problem is not that docs don't have it (though sometimes..), it's that they're confusing. Or maybe I am dumb, idk, but I hope there is some sense in what I try to explain

  • @leandrobarros4682
    @leandrobarros4682 2 роки тому +1

    I run command docker, but I can't see any queues in my dashboard :(

  • @LarrySmith1437
    @LarrySmith1437 2 роки тому +1

    Quick comment, a word about the environment you're working in would be helpful. Had to look up Rider. curious, why not VCCode?

    • @PhatBoyG
      @PhatBoyG  2 роки тому

      Because I use Rider, and it's all I've used for years.

  • @ivandrofly
    @ivandrofly 9 місяців тому

    9:38 - Rabbit UI

  • @june3878
    @june3878 2 роки тому

    What if I want to set up interaction between two projects of the same solution? I would be grateful if you have any suitable example.

    • @PhatBoyG
      @PhatBoyG  2 роки тому +2

      Plenty of samples show this, look at any of the recent videos (this video is over 2 years old).

  • @juliocesarfx
    @juliocesarfx Рік тому

    Hi, are you using obs to record the video? I was wondering what you use to display your circle shaped webcam?

    • @PhatBoyG
      @PhatBoyG  Рік тому +1

      I use OBS, but that video is three years old and I've completely swapped out to new hardware and a green screen at this point.

  • @TheGosha1994
    @TheGosha1994 2 роки тому

    Great video, thank you!

  • @liorbanai-kama2662
    @liorbanai-kama2662 2 роки тому

    missing the most import part: what is the command line to install the image..

    • @PhatBoyG
      @PhatBoyG  2 роки тому +1

      Using Docker compose, it's easy. Almost every MassTransit sample has it.

  • @gary6212
    @gary6212 2 роки тому +1

    I created a framework many years ago with dependencies on Mass Transit 2.9 .0. That framework is used all over my organization. I now need to update the Mass Transit library version because 2.9.0's dependency on Newtonsoft.JSON 5.0.8 is literally crippling my organization. Apparently that version of MT relied on some of the functionality that the Newtonsoft team stupidly decided to remove in v6 of their library. The fact that so many libraries have dependencies on Newtonsoft.JSON > 5.0.8 and MT 2.9 will not function with anything above 5.0.8 created a very real and profound problem for me (not your fault of course). But as I am trying to update my code to the newer version of your library I am finding it nearly impossible because there is almost no documenation. A lot has changed and your documentation is extremely sparse - just a couple code images of setting things up with default configurations on .net core web hosts. For the love of all that is holy, please document your library in writing where it can be searched/browsed, referenced, etc. How am I supposed to use this thing in all but the absolute most basic usecases you show in documentation?

    • @PhatBoyG
      @PhatBoyG  2 роки тому +3

      The documentation site (masstransit.project.com/) contains numerous references and examples, and there are a dozen samples showing how to use everything in practice. While I can appreciate the effort of migrating a codebase from MassTransit 2.9 to v8, you're likely having to relearn a majority of MassTransit from scratch aside from `IConsumer` much has changed.
      The MassTransit Commute playlist covers a majority of topics needed to build services using MassTransit.