Build Nest.js Microservices With RabbitMQ, MongoDB & Docker | Tutorial
Vložit
- čas přidán 9. 07. 2024
- In this video, we build a complete Nest.js microservices application using RabbitMQ as our distributed fault-tolerant message broker.
Source Code: github.com/mguay22/nestjs-rab...
Video on Nest.js Auth: • Easy Nest.js Authentic...
Video on Nest.js MongoDB: • Setup MongoDB With Nes...
Get my highly rated NestJS Microservices Course at a discount: michaelguay.dev/udemy
Timestamps
00:00:00 Introduction
00:00:54 Setup Monorepo
00:05:30 Add MongoDB
00:08:52 Orders App
00:18:00 Docker
00:28:24 Back to Orders
00:34:20 Microservices
00:37:59 Billing App
00:44:00 Connect apps
00:57:20 Authentication - Věda a technologie
This tutorial makes microservice implementation looks so simple. Thanks coder!
Awesome quality content. No BS.
I am watching you videos and this video specifically it is really great to have such content. Because there is almost no one on the internet who is helping with Microservices with NestJS. Thank you for the content from all of us. I am sure many people will take help from this video.
Every one of your video helps me so much, thanks for doing this!
Awesome! Thanks for the great content, waiting for the deployment part!! ♥ Thx Bro.
This content is unique, it helps us understand, something very complicated into something simple.
Great tutorial!
Awesome! Looking foward to the deployment video!
your tutorial is pretty awesome, very well structured
Such an amazing video. Really helped me learn and build my own custom project. Much Thanks. Looking forward for more nestjs content
The course that i waiting for, Thank you so much sir!
It was an excellent explanation. Ton of things, we can learn. Just waiting for deployment part
Wow. This dude is just giving away thousands of dollars worth education for free.
Salute to you sir. You are helping many.
I wish all the success in your career.
You are amazing! Thank you very much for such great content!
excellent tutorial ... great content in such a short time
absolute gold, thank you man
Really helped me get up and running quickly with NestJS Microservices and RabbitMQ, thank you! Grab beer or two on me!
Thank you so much!
Many thanks, great tutorial!
Thanks man, it's really comprehensive. I learnt a lot from it
Hello Michael, I would like to thank you very much for this content, it is very rich in detail and helped me a lot to understand a little more about microservices and also monorepo with NestJS. You've gained another subscriber. Congratulations on a job well done.
Thank you! Really useful tutorial.
Wow, this was the missing piece for me to start using microservices pattern. The puzzle is almost completed (just waiting for deployment part) :)
Thank you, Sir.
Best nestjs channel out there.
+1000 loved your content and looking forward for your next video. Thank you and best of luck
Awesome work !!,
Keep it up !!
Thx for great content, i learn alot from this video!)
This content is amazing, Thank you very much, is the best content ever!
Thank you very much! Viewer from Taiwan.
damn, I learn so many things in one video, thanks, bro.
Thanks so much for the tutorial and the source code, it is much help to understand the concept
Thank you for your support!
You are very good at teaching. Keep it up.
Very helpful tutorial. Thank you so much.
thanks so much for this video, i love it
Thank you for sharing awesome source code.
You are the best,thanks!!!
Great content 🙏🏻
You are the best!! 😍
thank youuu.... for the tutorial😁
You're the best. waiting for the deployment part
exactly 👍
The Best. Thanks
Great job.
Super interesting topics
great tutorial
Awesome content! Really well explained and it's insane how every time I watch some NestJS content I learn a new way of doing the same thing. This bad boy is actually quite flexible for a framework. Do you plan on doing a video where you e2e test an application? One of your videos on unit testing really helped me on work 🙏🏽
Thank you! I have a video on E2E testing here: czcams.com/video/R2ndY_JhxWk/video.html
Thank you much 👍👌🙌
Minute 5:46, I am loving this tutorial, thanks!
hey, you have dropped this ... 👑
Awesome!
thank you man
OMG!! Our Best Teacher Are Back🥰
Appreciate the support!
Very good one
superb bro...
Hi Michael, this is really nice, keep it up and thank you.
I was wondering instead of building authentication service from scratch is it possible to integrate keycloak in your setup as well as api gateways like apisix? If you can create a video that incorporates the two, that would be great. Otherwise thank you for such wonderful and educative videos.
Thank you
Get my highly rated NestJS Microservices Course at a discount: michaelguay.dev/udemy
AWESOME
Thanks for the awesome video Michael. I was wondering how it is possible to connect to 2 databases from one of the microservice and second microservice connects to only second database and both are responsible for read/write operations in that database. I know there can be microservice communication used but if we wan to avoid the delay.
The way you explained is really awesome and helpfull. I have some confusions : Why do we need to create two JwtAuthGuard and how you are deciding where to use JwtAuthGuard and flow of its execution?
I got issues with MongooseModule, it says it can’t connect to mongodb-primary 😢
Wow 🤩
Very good stuff indeed! Anyone got an idea of how the MongoDB connection string will look like if I try to connect to the running db instances using Compass?
Nice video and great content , Can you make a enterprise level application using NestJS with micro-service architecture in which you cover e2e testing , caching, queue management system etc. which required to make production level application using micro-services architecture.
really good tutorial, thank you for creating this video
bay the way, sometimes when creating an app we also need the second auth for admin, regarding with auth guard, what is the best practice you advise for this case?
Hi! Thanks for the great tutorial... Is it possible to specify queue while emitting the event?
@Michael, thank you for the great tutorial. I have a quick question regarding deployment. You see... the Billing service doesn't listen to any port. With this setup, how do I go about health-checking the service container within AWS ECS? The easiest option that I came to my mind is making it hybrid app just like the Auth service to be able to make a HTTP call to the container via the port. What else option do I have?
How would I go about enabling HMR for the individual microservices? I am able to do it for regular NestJS app setup, but with this shared libraries approach, I am not able to figure it out unfortunately.
How do we ensure the transaction atomicity in case of any failure, such that the messages are not standing as orphan data in rabbitmq for processing?
Hi, at 1:11:05 in ordering apps auth section, I don't understood why are you inject(AUTH_SERVICE) constante which is a string value as injector for clientProxy. How works this and in what way does this constant refer to this service ?
Hey Michael, thanks for the tutorial, super educative! Do you plan to do a tutorial for authorization in NestJS?
Thanks! I have a video on this, check out my channel.
Great content. Michael Guay, on the auth service, why is it that instead of validation I do get always a 401 Unauthorized? Is there a way of working around this?
Thank you so much for the great tutorial!
Just a heads up for anyone using Macbook M1 with the ARM64 chip, Bitnami doesn't support it yet.
Yeah ;(
litterlay a gold mine . nothing else to say 😘😘
How does my application consume multiple queues. I saw an approach someone suggested on stackoverflow where you repeat the "app.connectMicroservice" for each queues, is there a cleaner approach ?
Great tutorial, thanks. Why using MessagePattern and switch to rpc? In Auth microservice the rmq auth queue is connected, isn't that mean that we can use EventPattern in auth controller?
@michael thanks. Can u throw some light on nestjs with saga topic? I am really confused with saga
Very cool 👍 graphql federation with microservices maybe in future ?
Thank you sir for everything you're doing for us, but could you please tell me why you have followed the one shared db approach for all microservices you have implemented? The one db per each microservice could be more suitable for microservices architecture.
I'm wondering if there or anywhere else a tutorial for doing database stuff like in this video but with typeorm and rdb?
Really nice, were you able to connect into mongo atlas? I can't and it would be great to see data into database
Great content. Thank you. I have a small doubt regarding registering the RmqModule. You have registered it in order module import. However If I want to use it in another module should I register again? Or is there anyway I can register it to a common module and import that module everywhere else in my code. For example emailQueue is something that I might require in multiple modules (order, billing and auth). Can you suggest me a generic way to register EMAIL_SERVICE (emailQueue) in all the modules please?
Wonderful video mate! Helped a lot to understand the system and I would like to give a feedback. Can you make commits as you make progress? For example we have "docker", "microservices" and "billing app" chapters on youtube, wouldn't be good if you make commits for each youtube chapter?
well explained, learned a lot, liked the way you make use of the common library for rmq and mongo
I'm having a bit of trouble connecting to my mongodb when using compass, can I simply connect on localhost:27017 with root:password123 ? or is it different with the way it's set up in your video?
Why I can't connect mongodb replicaset in my Macbook M1. Error throwing like this
[Nest] 69 - 10/24/2023, 10:35:24 AM ERROR [MongooseModule] Unable to connect to the database. Retrying (1)...
@Michael Guay hey, do you have any course about nestjs with microservices from scratch?
or another option, what is the best approach to learn nest js and microservices? i know express, and i know the concept of microservices, but i did not understand what is nestjs and nestjs microservices . thanks
Hi. How to set username and passworf for RabbitMQ in connection options?
I also can not wait to see deployment
What about polyrepo .. is it a same way?
I cannot find the bitnami mongodb image repo seems it is no longer open sourced?
Did you create an APi gateway?
Thank you for great tutorial. But I'm not idea write unit testing for controller and services. I try to write a. unit test but not work because it many dependencies. Please help or guide how write unit test.
instead of inserting data into database into orders app, when i try to do the same actions into billing no any data saved into database, i tried to save your passed data into billing microservice in database. i get 201 but there isn't any data into database and that return empty
How in this configuration work whis different queue in one client?
wowww
Thanks! Tutorial straight to the point.
In my case I came across the problem, have you dealt with this error? "There is no matching message handler defined in the remote service."
Nice video Michael but I suggest to use any diagram for more simplification before starting that will make it very easy and will get new ideas from comments sure
Hi Michael. I followed through the video however I want to deploy this on a service like Render. Could you help with this?
I got issues with MongooseModule, it says it can’t connect to mongodb-primary. Please resolve. @Michael
How do we add multilpe database connections ? Can someone help
Hi Michael,
May I know why both on Auth and Billing service you define the app.connectMicroservice functionality but in Order service you didn't define the connectMicroservice instead you call the RmqModule.register which calls the ClientsModule.register, is there a rule for this one? because I thought when we want to define our service as microservice we need to call the connectMicroservice for each services? sorry im new to microservice and nestJS.
the order service serves as the entry point into the application. Therefore you need to instantiate Rabbit MQ from there.
how to setup load balancing in multiple server
Error:
for mongodb-primary a bytes-like object is required, not 'str'