From the course: Node.js: Microservices
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Consuming orders - Node.js Tutorial
From the course: Node.js: Microservices
Consuming orders
- [Instructor] We have now orders waiting in our queue. Now we have to create the logic in the order service to consume these messages and create orders from it. For that, I will now open workspace microservices. I open the order service, and I also head to the order service console. And I stop the script real quick because I have to npm install dash s amqplib, because obviously we need to store as well. And, I'm starting the script again. And now the question is where should this logic live? And it can basically live anywhere. I will now add it to my app.js script. So somewhere down there before the module gets exported I will simply add this logic now, because it's independent of any route. And now I will use something a little bit specific to nodejs, so I will create an async function that calls itself so that I can use async await within this function. So I start with async, then parenthesis, then I prepare the…
Contents
-
-
-
-
-
-
-
-
-
(Locked)
What's your goal for this chapter?2m 27s
-
(Locked)
Chaos testing4m 18s
-
(Locked)
Adding caching to reduce load and bridge outages2m 40s
-
(Locked)
Using queues for decoupling1m 43s
-
(Locked)
Installing up RabbitMQ1m 24s
-
(Locked)
Setting up the order service3m 2s
-
(Locked)
Producing orders6m 47s
-
(Locked)
Consuming orders9m 3s
-
(Locked)
-