This tutorial demonstrates integrating RabbitMQ with NestJS microservices. It covers configuring asynchronous messaging, handling message retries via queue management, and implementing manual message acknowledgement to maintain control over processing failures and error handling within a Dockerized environment.
Length 7:23
Captions English (Generated), Spanish (Auto-translated), French (Auto-translated), Korean (Auto-translated), Portuguese (Auto-translated), Vietnamese (Auto-translated) #nestjs #rabbitmq #microservices #docker #message-queue #asynchronous #programming #backend #coding #software-engineering
0:00 Now we can also see the rest of our microservices have started up 0:04 successfully, and we can go back to Postman 0:06 and make sure all of our 0:07 functionality is still working as expected. 0:10 So I'll go ahead and create a new user so that we start from 0:14 scratch. So create a new user by targeting our auth 0:17 service/users route. 0:20 I've gone ahead and created the user. 0:22 I'll go ahead and log in with its credentials, so make sure I have 0:26 the correct email, test user two. 0:29 I have my JWT set. 0:32 So now if I launch a request at localhost three 0:34 thousand/reservations to send a post request 0:38 to create a reservation with our typical reservation 0:42 payload, I can see if I send this request off, 0:46 I come back with a two oh one created response. 0:48 So our reservation has been successfully created. 0:52 And then if we look at our Stripe dashboard, I'll go ahead and refresh, 0:56 and we can see we have a new forty-five dollar payment that has 1:00 just been processed. And if we go to our email provider, 1:04 you can see I have a new email from Sleeper saying that my payment has 1:08 completed successfully. So we can see that our 1:12 microservices are working just as they did before even though we 1:16 swapped out our transport layer. We didn't have to change any of our 1:19 underlying 1:20 code thanks to the NestJS microservice abstraction. 1:24 So now that we have RabbitMQ set up, let's show the differences 1:28 in our retry logic by going to the payments 1:31 controller again, and we'll rethrow that error in the 1:35 same spot. So let's go ahead and throw 1:40 that error when we create the charge and see what happens now. 1:44 So now after recompiling, if we try to create a 1:48 reservation again, we get that five hundred internal server error as
The rest of the transcript is for members.
Sign in