Тёмный

E-Commerce Microservice with NodeJS and RabbitMQ | NodeJS Microservice | Microservice Architecture 

Mano Sriram
Подписаться 3,3 тыс.
Просмотров 52 тыс.
50% 1

In this video, we'll build a complete e-commerce microservice application using NodeJS and RabbitMQ.
Github Code Link: github.com/manosriram-youtube...
Don't forget to Subscribe!
Share your ideas for my next video: request.manosriram.com
Find pair-programming partners: mydevfriend.com
Timestamps:
Intro: 00:00 - 01:00
Setting up project and installing libraries: 1:00 - 5:26
Creating User Schema: 5:26 - 7:27
Register Route: 7:27 - 8:56
Login Route: 8:56 - 11:59
Testing Register and Login route: 11:59 - 13:25
isAuthenticated middleware: 13:25 - 16:54
Setting up product-service: 16:54 - 21:43
Creating Product Schema: 21:43 - 22:49
Create Product route: 22:49 - 26:44
Buy Product route: 26:44 - 30:12
Create Order Schema: 30:12 - 31:12
Order and Product service queue handling: 31:12 - 45:55
Outro: 45:55 - 46:03
FOLLOW ME HERE:
Website: manosriram.com
Github: github.com/manosriram
LinkedIn: / manosriram
My Blog: blog.manosriram.com
Twitter: / _manosriram
📻 Join the Discord Server: / discord

Опубликовано:

 

10 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 102   
@DarknessDescend
@DarknessDescend 2 года назад
I loved this tutorial! Thank's for sharing, man!
@chandanchhajervlogs1051
@chandanchhajervlogs1051 2 года назад
Awesome tutorial video! I just loved it.
@svnesh2558
@svnesh2558 6 месяцев назад
Excellent tutorial, clearly explained with code & errors also, very much appreciated. Thanks a lot
@kk-kw7yx
@kk-kw7yx 3 года назад
You are a life saver.
@ramiworkstation
@ramiworkstation Месяц назад
Thank you very much for sharing such a great tutorial. 👍
@webhook4729
@webhook4729 5 месяцев назад
Gratitude for the incredible Node.js microservices architecture integrated with RabbitMQ for RU-vid! This innovative approach has revolutionized the way we handle our platform's complexity, enabling seamless communication and scalability. With Node.js' agility and RabbitMQ's reliability, we've been empowered to deliver a top-notch user experience while efficiently managing our growing audience. Huge thanks to the brilliant minds behind this architecture for providing us with the tools to thrive in the dynamic world of online content creation. 🚀🙏 #Grateful #NodeJS #RabbitMQ #RU-vid"
@naveenkumarhr3864
@naveenkumarhr3864 27 дней назад
simple and straight forward approach i ever seen for micro-services tutorial and more helpful than others. Thank you🖤
@alshojamikbal8510
@alshojamikbal8510 3 года назад
Good Info Man Keep going
@selvabalajis3924
@selvabalajis3924 3 года назад
I understood how It works clearly. Thanks for your nice explanation
@manosriram
@manosriram 3 года назад
Thank you Selva 🙂
@amacodes7347
@amacodes7347 2 года назад
Thanks very informative
@sina-qh8wm
@sina-qh8wm Год назад
just Perfect...
@AwakeningofAI
@AwakeningofAI 3 года назад
great stuff mate.
@manosriram
@manosriram 3 года назад
Thank you Drake.
@Viralstuffzworld
@Viralstuffzworld 2 года назад
you make easier microservice understanding using node js
@fyargat
@fyargat 2 года назад
Thank you!
@nitindhiman2607
@nitindhiman2607 3 года назад
This was very informative. Thanks
@manosriram
@manosriram 3 года назад
Glad it helped 🙂
@thisissharief7651
@thisissharief7651 2 года назад
wounderfull and very very thanks for the github link
3 года назад
I got the concepts, thks bro
@manosriram
@manosriram 3 года назад
Thank you, glad it helped.
@sitcomrave
@sitcomrave 2 года назад
Came here for message queue ,impressed by vim skills.
@manosriram
@manosriram 2 года назад
Thanks Vamshi :)
@vasurangpariya8492
@vasurangpariya8492 2 года назад
Very informative video but if you create big project and explain pros and cons of rabbitmq about scalability and how to use it in production and about security things it will be great
@kumar_sanjeevdutta1069
@kumar_sanjeevdutta1069 День назад
Great
@codedestiny6955
@codedestiny6955 3 года назад
Thanks for your time, I will use this project to develop logging system using elk stack
@manosriram
@manosriram 3 года назад
Thank you, glad this video is useful for you :)
@codedestiny6955
@codedestiny6955 3 года назад
@@manosriram what if our queue goes down ?? How do we ensure our service availability
@manosriram
@manosriram 3 года назад
@@codedestiny6955 Usually, the messages in the queue will be persisted and when the queue is up, will be consumed which I have demonstrated at the end of the video.
@pramodkharade5373
@pramodkharade5373 2 года назад
@ManoSriram : worth to watching video and simple way to understand the Microservice with Rabbitmq. Could you please create application with Kafka as well
@manosriram
@manosriram 2 года назад
Thank you Pramod, there is already a video on Kafka on my channel. You can check that out.
@ADITYAKUMARking
@ADITYAKUMARking 3 года назад
this channel is underrated.
@manosriram
@manosriram 3 года назад
Thank you Aditya🙂
@prabinlamsal74
@prabinlamsal74 11 месяцев назад
I love seeing you use vim while doing these tutorials. hahaha. great.
@manosriram
@manosriram 7 месяцев назад
Thanks a lot :)
@techtravis5610
@techtravis5610 3 года назад
Sir, i have to add frontend to this, what will entry point from browser and all can u explain . Thank you
@amanullahghouri1149
@amanullahghouri1149 2 года назад
thaks subscribed too
@mariomp4973
@mariomp4973 2 года назад
Hello :) how are you, a query ... if in the case I want to add another function called UpdateOrder in the order service then I add it but how did you call it from Auth for example? because I see that the example is when you have a single createOrder function and you call it by the "ORDER", as it would be when you want to call a new UpdateOrder function with Income Parameters.
@hoseinmirian
@hoseinmirian 2 года назад
big thanks. great video. one question';' in a actual prod ver I saw ur github code, so how each service which have separated repo can have auth service or isAuthenticated service shared among them without repeating the code? tnx
@blitzkreig4887
@blitzkreig4887 Год назад
How does RabbitMQ compare to Kafka , when you consider a Ecommerce application ?
@mjjuneja
@mjjuneja 3 года назад
Hello, @ManoSriram eventually what you did was right apart from creating another queue for response in the same route. The major purpose of using queues is to get asynchronous nature. Apparently, you destroyed that purpose by defining the response queue at the same spot. Even if your queue would have worked fine in a sync manner, if we look for a rather scaled and bigger architecture you will start receiving wrong responses because of ill order acknowledgments.
@manosriram
@manosriram 3 года назад
I agree with you, this is just a sample or demo application, so I think those problems are negligible.
@mjjuneja
@mjjuneja 3 года назад
@@manosriram no doubt, rather easy and straightforward explanation! Good work mate.
@lancerdonnie
@lancerdonnie 3 года назад
Awesome content 👍. Just when I was looking for how to connect services with message brokers.
@manosriram
@manosriram 3 года назад
Glad it helped you :)
@riteshthakur9250
@riteshthakur9250 3 года назад
Let's say we are deploying this whole application in aws so how we will configure nginx for order service because this service is not getting any api request or response it's just getting data from message broker and using it to make orders but it's running on a port to do all these tasks so when we will deploy it to aws how we will configure it for nginx proxy pass or location for api we can upstream it for server ip which we will get from aws instance and port of the server but what about location and proxy pass please give a suggestion
@RahulAhire
@RahulAhire 3 года назад
At what scale using message queue make sense? I have known that queues can be utmost helpful during really high amount of traffic when managing throughput is essential and also has retry feature. For eg. AWS lambda has a its own throughput limit was can be balanced by SQS, step function, etc. How helpful is it for small scale where I just want to handle basic crud app? What's your view? Edit: small suggestion, treat your audio in adobe audition with denoise filter and parametric EQ during editing to remove background noise and it will sound better.
@manosriram
@manosriram 3 года назад
Message queues are most useful in microservices. Microservices are used at Scale (Huge codebases). For small-scale apps, it can still help you to handle your application if it is scaling steadily. Thank you, I have found the audio bug and will fix it from next video :)
@guruprabakaran5168
@guruprabakaran5168 2 года назад
It's really helpful. Could you please help me to achieve this approach in Python or Flask python?
@023PrashantSharma
@023PrashantSharma 2 года назад
you should show folder structure, it will help
@mikejames6452
@mikejames6452 Год назад
Hi anyone can explain why /product/buy we need to hit api twice for correct answer .Also if i shift res.json in consume method than error occurs
@mohitsoni8951
@mohitsoni8951 3 года назад
Nice, good info. Can you structure all these using typescript and make routes, controller, db connection and db model in different class file.
@AnthonyFinix
@AnthonyFinix 3 года назад
Your video is very informative and thank you very much. But it does introduces further problem of dependency among services. And response is essentially waiting for the whole saga to be completed. Can you please publish a video about how to mitigate these problems
@manosriram
@manosriram 3 года назад
Yes, thank you. Will make a video on this.
@bushranikhat2326
@bushranikhat2326 3 года назад
How to write from rabbit mq to mongodb?
@sivaganeshchitti
@sivaganeshchitti 2 года назад
Awesome video.can you please advise. is it possible separate each micro services in different languages like PHP,golang. Each micro services connect to one nodejs api.like grpc
@manosriram
@manosriram 2 года назад
Yes, it is possible to have different microservices in different languages. Only the API matters.
@rajatgupta6409
@rajatgupta6409 3 года назад
Nice Man, thanks. But just one question. Clear and Simple question or you can say it's my doubt only that For Microservices, we do not need docker (compulsory) right? we can only use Rabbit MQ and node js and other stuff right ?
@manosriram
@manosriram 3 года назад
Yes, you can install rabbitmq locally and connect it with the application.
@johncarter4091
@johncarter4091 3 года назад
How we create relationship between 2 microservices like products and order?
@codingintelugu8820
@codingintelugu8820 2 года назад
By raising events! we can use kafka or rabbitmq to consume & emit these events, where products & orders handle that event data accordingly
@kalkidan.t
@kalkidan.t Год назад
great tutorial but why do you have to use vim to write the code? I find my self wanting to see the full folder structure a lot in the video.
@manosriram
@manosriram Год назад
i usually write code in vim; but i'll try to show the file tree from now on.
@zulqadarabbas7567
@zulqadarabbas7567 2 года назад
I am wondering, cant you make the isAuthenticated function into a separate middleware that isn't in the project dir?
@manosriram
@manosriram 2 года назад
Sure, we could do that.
@mdazimbabu5001
@mdazimbabu5001 Год назад
we can also use the kafka insted of rebbitmq ?
@manosriram
@manosriram Год назад
yes, you can.
@djamaatul
@djamaatul Месяц назад
i not understand , its weird, api /product/buy channel consume no have await, but got response with data from consumer, it code syncron and blocking ?
@djamaatul
@djamaatul Месяц назад
can you explain?
@socialcatalyst2608
@socialcatalyst2608 2 года назад
Thanks. Use please rtx voice.
@developpementdigital1036
@developpementdigital1036 Год назад
Thank you for this video, it war very clear, I want to dockerise this services and use nginx as reverse proxy, can you please tell me how can i handle with middlware isAuthenticate, should i make its own container ?
@manosriram
@manosriram Год назад
I don’t think you need to dockerfile the middleware. You can just use it without separately containerising it
@developpementdigital1036
@developpementdigital1036 Год назад
@@manosriram thank you for your response. The solution i found is integrating the middlware in each service. I don't know if it's the best approch or not but i can't use the middlware separately because i'm using docker-compose for managing my containers.
@patrickboahene1449
@patrickboahene1449 3 года назад
@Mano Sriram I need a little clarification please. Why did you send data back from the order service to the product queue
@manosriram
@manosriram 3 года назад
Because the client called the Product API. We have to return a response from that exact api. So after finishing the job in the order service, we return back data to finish and respond to the client.
@patrickboahene1449
@patrickboahene1449 3 года назад
@@manosriram ​ ok...Thank you so much
@nagashishsv843
@nagashishsv843 3 года назад
Amazing video bro, but small issue.. at the first time u hit the route, u got an empty response (at 42:32 ) again next time u hit the route then a response came, (at 42:34 ) Is this correct? Actually we are getting wrong response for the current hit to that route((I,e we are getting response of the previous hit) At very first time, before the queue consumes the message, the call back returns order, where it is undefined still, so u got no output. By this time your queue will consume message and assigns it to order, so that in the next hit to the route, this order value is coming, which was supposed to come in the before hit itself. So to get the correct output, we need to hit the route twice… So how to solve this issue.??? Can we write return res.json(order) inside the consume function itself? (I did like this, the 1st hit gave me correct output, but while in the 2nd hit, the server is getting crashed, saying Error: Can't set headers after they are sent, ) Please Correct me if I am wrong..
@manosriram
@manosriram 3 года назад
Yeah, you cannot return inside a consume function. So, I tried returning outside the function. I think the problem might be like, it always waits to consume and you cannot return all of a sudden, maybe we can have some callback fn which helps us to return after consuming. Will try to do a video on this if I find a suitable solution. Thank you for watching :)
@harishkumark9010
@harishkumark9010 2 года назад
yes sending request twice returns the response back any solution for this
@boubaker86
@boubaker86 Год назад
@@manosriram you can simply use await to wait for the consumption first then you can send a response
@kk-kw7yx
@kk-kw7yx 3 года назад
Can you make a video on kafkajs in node microservices app soon sir? I am waiting to implement in my project. TQ!
@manosriram
@manosriram 3 года назад
Sure, will do very very soon :)
@YOitsBA
@YOitsBA 2 года назад
How did rabbitmq know which order to return to which request? I'm imagining a case where hundreds of people are hitting that route and adding items to the order queue, how would the consumer of new order know which order to return with which request?
@gilbertokullo63
@gilbertokullo63 2 года назад
thanks for asking, am stuck right now doing something like this
@kk-kw7yx
@kk-kw7yx 3 года назад
Can you make a video on kafkajs in node microservices app?
@manosriram
@manosriram 3 года назад
Sure, will do it in the very near future.
@piyushmahapatra5402
@piyushmahapatra5402 3 года назад
@@manosriram Please do this bro,your channel is going to be my new hangout
@abhijeetshikharvlog1444
@abhijeetshikharvlog1444 3 года назад
Can you make video microsevices without rabbit mq like i want api gateway
@manosriram
@manosriram 3 года назад
Yes, I am thinking of doing a Gateway for microservices very soon. Do subscribe to stay updated :)
@abhijeetshikharvlog1444
@abhijeetshikharvlog1444 3 года назад
Can u help me create microsevices i will send mail
@chandanSINGHIIMS
@chandanSINGHIIMS 3 года назад
please make same program with kafka Pleaseeeeeeeeeee
@manosriram
@manosriram 3 года назад
I already have a video on Kafka, do check that out 😄
@windwardhive7363
@windwardhive7363 3 года назад
github repo link please
@manosriram
@manosriram 3 года назад
Updated link with github link :)
@MukeshSharma-lo1vv
@MukeshSharma-lo1vv Год назад
Please use vs code with good theme, and also the file structure should be visible
@riteshthakur9250
@riteshthakur9250 3 года назад
Bro what in this world you are not using visual studio code
@manosriram
@manosriram 3 года назад
I prefer Vim over VsCode.
@mohitharshan9388
@mohitharshan9388 3 года назад
@@manosriram why do you prefer Vim?
@subhampanja4590
@subhampanja4590 Год назад
Where is your pain bro? You are teaching people in a very complicated manner. I know you are a good coder and you are committed to using a vim editor for your learning means remember the Syntex. But just think people here are coming to learn something .why you are making it complicated.
@Looneytune
@Looneytune 2 года назад
No ESLint, no TS, not real microservices, RabbitMQ doesn't any sense here, why did you go for gRPC, Kafka or something, would be a better fit. I don't wanna be mean, but nobody should take this as an example.
@amacodes7347
@amacodes7347 2 года назад
what have u done? Dumb ass u're already mean. Give ur opinion as in pros and cons and state ur preference pussy
@Anshucodes
@Anshucodes 5 месяцев назад
the only thing was missing here was api gateway !!
Далее
Authentication as a Microservice
50:26
Просмотров 214 тыс.
Alisha Lehmann joins Juventus Women 🤍🖤
00:16
Просмотров 1,2 млн
RabbitMQ - RPC with NodeJs (request-reply pattern)
1:02:47
NodeJs Microservices using RabbitMQ (Message Queueing)
40:38
Node.js is a serious thing now… (2023)
8:18
Просмотров 632 тыс.
Tutorial RabbitMQ Dasar (Bahasa Indonesia)
3:02:21
Просмотров 18 тыс.
NestJS Microservices with RabbitMQ | Messenger Clone [1]
1:08:29