Get the source code for this video for FREE → the-dotnet-weekly.ck.page/microservices Want to master Clean Architecture? Go here: bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt
MassTransit is a fantastic library. I had to build a quick POC and use RabbitMQ with Docker. Then we decided to replace RabbitMQ with Azure Service Bus with ease! Great video!
Nice. It would be great if you focused more on exchanges, queues, topic, fanouts. I’m service bus guy, so i hoped to learn more about using rabbit with massyransit
@@MilanJovanovicTech you definitely should mate, you have talent to explain everything in simple and practical manner without “water” and useless successful-success garbage
This is great. Do you think you could make a video about docker for this specific project? It would also be interesting to see how this could be deployed to AWS or Azure.
Thanks Milan. As always, your videos are top-notch. However, I can't find the playlist for this series so it is easy to follow from the start. Stay awesome! ❤
I rarely like or subscribe to video but this tops the charts, Do you offer tutoring one on one. I need to improve my skills and also have a close mentor close by.
- Saga: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-dlXCodLxhag.html - Saga compensation: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FPVzevl6Ri8.html I'll do a video on ES sooner or later
Hi Milan, I really enjoy your tutorials, can you explain the distribution of database in microservices? for example customers, orders and products. It 's little bit unclear for me.
Great video. thank you. Could you please create something with container. 1 container containing multiple services and they interacting with each other. In this scenario can the MQ be outside the container? Thanks again!
You could put the message classes in both projects, but they could get out of sync that way. You don't want the service to reference each other for sure.
@@MilanJovanovicTech What do you think about these recommendations in this case? "The integration events can be defined at the application level of each microservice, so they are decoupled from other microservices, in a way comparable to how ViewModels are defined in the server and client. What is not recommended is sharing a common integration events library across multiple microservices; doing that would be coupling those microservices with a single event definition data library. You do not want to do that for the same reasons that you do not want to share a common domain model across multiple microservices: microservices must be completely autonomous. For more information, see this blog post on the amount of data to put in events. Be careful not to take this too far, as this other blog post describes the problem data deficient messages can produce. Your design of your events should aim to be "just right" for the needs of their consumers. There are only a few kinds of libraries you should share across microservices. One is libraries that are final application blocks, like the Event Bus client API, as in eShopOnContainers. Another is libraries that constitute tools that could also be shared as NuGet components, like JSON serializer." learn.microsoft.com/en-us/dotnet/architecture/microservices/multi-container-microservice-net-applications/integration-event-based-microservice-communications#integration-events
I think this is a limitation of masstransit, requiring same namespace for messages to be consumed. Requiring same namespaces on both ends is not “loosely coupled”
Hello Milan! Thank you for the video. I watch all your videos and they are all awesome! I wanted to ask you what happens if the consumer for any reason is not running at the moment the message is sent. In that case, the consumer is going to be able to receive the message the moment it starts running again?
This is the first time I've seen joining queries from different tables by doing a call in a call, thanks for showing this. Are there any negative effects to that the outer call being asynchronous and the inner call being synchronous? Also is this breaking principles if I would do this in domain driven design but with two aggregates?
The inner call isn't really a "call" - it just produces an IQueryable which EF can include in the expression tree. So it's just a single query at the end of the day.
@Milan what are your views on MassTransit vs Rebus? I just referenced your Saga Pattern video using Rebus for work. Now I woke up with more questions :)
How do you handle data loss? For example after you publish some event (service A) and it is important, that other system/service (B) received this event. Let's say I stopped B service for update. What about such scenario?
@@MilanJovanovicTech i am not sure about masstransit but if you throw exceptions while handling the event in service B masstransit wont send ack to rabbitmq. Isn't that so?
This is amazing!!! But if I want to consume only selected messages, I mean, How my application can consume only selected messages and leave others message in the queue
Great video! Any plans on GraphQL HotChocolate content ? This could also be with microservices like Schema Stitching, Federation and the most recent one - HotChocolate Fusion
Amazing vídeo! If I need to getId from another context/domain, I would using the autorest integrated with my CI/CD and generate a sdk instead. It seems less work 😅. However, what are your thoughts about it?
Hi Milan, thanks for explanation. How about structuring consumer class in respect to Clean Architecture? According to my understanding from this video, it was in Application Layer (CMIIW), but for communication to the external layer, CA required us to place the code in Infrastructure layer.
I'll have to do a take two on this video. These days, I place the consumers in Presentation (like another endpoint). And only use them to send commands.
@@MilanJovanovicTech Fair enough. But, in this cause I would have used the Join method in the query rather than the context method you used. Although in resolution it might end up wit the same query. But, I'd prefer the join for code clarity.
I am facing problem in my project i will explain simple i have 2databases 1is master where i have ticketstatus tabel and i have ticket database where i am storing ticketstatusid in get tickets api u want to send ticketstatus data as well with tickets By now u might have understood these are 2different apis whats solution for this
Hey Milan, I'd like to know can we use AWS SQS instead of RabbitMQ as MassTransit. Or what is its equivalent on AWS? I am confused about how can we use pub-sub method with RabbitMQ. I think I have a concept and definition confusion.
I don't like MassTransit because it creates a wrapper around the message. If it were possible to pass the service data not in the wrapper but in the message header, it would be ideal.
Hallo @MilanJovanovicTech, there is something I'm not sure about Microservices are made so they are scalable so the 'Newsletter.Reporting.Api' might have 10 instances because it's heavily used; wouldn't this mean the consumer is called on 10 different api's which means 10 entries are added? What is the round away method to avoid this?
Great article. Do you think it's better to publish the event before the SaveChangesAsync in the DB and have a consumer in both apis to consume the message and use it to save the data ? Because with your aproach, if you loose the connection with your message broker, you loose your message and have a data problem (one db updated but not the other)? Or it's overkill ?
Always publish after it becomes a fact. So publish after SaveChanges is the only thing that makes sense. As far as reliability issues, there's the Outbox pattern for that.
In many case's you can FireAndForget and not to wait for executing the second microservice. Kafka has this option maybe RabbitMQ can also. This is my opinion. Nice video, cheers.
This is doing that - when the publish to the queue completes, the initial request is done. It's also just instantly hitting the consumer breakpoint, so it might give that impression.
Milan Thanks for the easy explanation. I am regulary following your videos and articles to implement the application architecture from scratch. I have few questions 1. How to handle multiple consumer for single event? eg. OrderCreated event to handle the reduce inventory, Update the counts for user order, product sellCount, etc... 2. Does the request wait untill all multiple event consumed..? 3. Is it mandatory to wait for response? eg. OrderCreated Email or SMS send..?
1. MassTransit takes care of it. You just write the consumers. And each handler will run concurrently. This is important to keep in mind. 2. No. It will just publish. Maybe there's a way to wait for ACK message (worth checking) 3. No