RabbitMQ - RPC with NodeJs (request-reply pattern)

preview_player
Показать описание
We're gonna implement the RPC (remote procedure call) pattern in Nodejs, using 2 different services: RPC_Client and RPC_Server, in order to understand the concepts of request-reply in RabbitMQ while creating a real case scenario.

Useful links:
---------------------

TimeStamps:
----------------------
0:00- What is RPC
0:33- Explaining how it works
2:16- 2 Problems that we need to handle
3:09- The reply_to and correlation_id properties
3:52- Where is the exchange in all this??
4:42- Getting started with the RPC_Client application
5:42- Creating the RabbitMQClient class
7:28- Adding the Initialize message to our RabbitMQClient class
12:13- Creating the Consumer class in RPC_Client
16:00- Creating the Producer class in RPC_Client
21:14- Finalizing the RabbitMQClient class
23:28- Analyzing RabbitMQ monitoring management tool
25:13- Calling the /operate API
26:40- Problem when using the rabbitMQClient in different files
28:31- Fixing the first problem
29:26- Showing the problem with using new instances
30:00- Turning the RabbitMQClient class into a Singleton
34:00- Using the RabbitMQClient as a Singleton in our app
35:34- Planning for the RPC_Server
36:09- Modifying the code in the RPC_Server application
42:28- Creating the MessageHandler in RPC_Server
49:10- Analyzing RabbitMQ monitoring management tool
50:02- Adding the headers property to messages in RPC_Client
51:42- Consuming the RPC_Server response correctly
52:30- How to match the responses to their requests?
53:20- Adding the Event Emitter and emitting new messages from the Consumer
55:11- Subscribing to the event inside the Producer
56:48- Testing the events emitted by the consumer and received by the producer
57:41- How to return the response value that was emitted?
58:46- Wrapping the event with a Promise() to return the response value correctly
1:00:10- Explaining that you can produce errors as well from your RPC_Server and handle them in your RPC_Client
1:00:56- Message expiration time and request timeout
Рекомендации по теме
Комментарии
Автор

This is YouTube's hidden treasure that's just waiting to be found!

In-depth RabbitMQ content is very scarce on YouTube, and message brokers in general, and you did a signifacnt job on explaining it.
Impressive work and effort, bro! Can't wait for this to blow up.

basemmostafa
Автор

I couldnt find one proper video explaining RPC with node... Finally found this

t-distributedkid
Автор

Thank you for this. Cheers from norway!

Fullflexno
Автор

Thank you for this very good and professional course that is available for free

farzadforuozanfar
Автор

I can see your channel growing quickly. You're giving the people what they need 👍💪

theunfilteredcomment
Автор

Subscribed :), one thing you can add is to remove the event listener from once the response came back

LawZist
Автор

such nice man you are, such nice tutorial

NOName-geiu
Автор

Thanks for the tutorial you saved my a$$

ShubhamSharma
Автор

Amazing bro, thank you for sharing such precious knowledge

hassanmhassan
Автор

Your content is truly invaluable! If you have the time, would it be possible for you to create a video or series on building a mini ecommerce or social media backed application using multiple services, such as authentication, user management, order management, product management, and cart management, while adhering to best practices? This would greatly benefit learners looking to expand their knowledge in this area.☺

anonymoususer
Автор

Great video man! I would want to know how you did this magic on 19:31? (check available props of object) - which is hotkey for that? I'm looking forward new videos about RabbitMQ ! Thanks

andrewananenko
Автор

Thank you for the Tutorial, may I ask why we created two channels each for a producer and a consumer, Can't we connect both producer and consumer to a single channel on the client side and similarly connect producer consumer to only one channel on server side, so in total we have two channels on RabbitMQ?

SalmaElMorshedy
Автор

That was the one part that was missing in my life 😅

SmartBuy
Автор

How to manage rollback mechanism.? for example if my 1st service have update some data after update completed based on 2nd service add some data, if 2nd service failed i want to rollback 1st service execution, how i can achive multiple micro-service in nodejs.?

Nikunjtechhive
Автор

this is really awesome content about RabbitMQ ever seen . I got good knowledge from this and your other video about rabbitmq, Can you provide me the source code link ? Thankyou again

bikramgyawali
Автор

can i use same request-replay-pattern with kafka.? can you please create video about request-replay-patter with kafka in nodejs with typescript.?

Nikunjtechhive
Автор

hi, what if a service acts as both a client and server?

hoangofficial