#Implementing DLQ and retry logic in rabbitmq

1 messages · Page 1 of 1 (latest)

dusk plaza
#

Hey guys,

I've done the basic configuration for a rabbitmq powered microservice app here: https://github.com/kasir-barati/nestjs-materials/tree/main/microservices/complex-reservation-rabbitmq

And now I was wondering that, yes, I can set noAck here: https://github.com/kasir-barati/nestjs-materials/blob/main/microservices/complex-reservation-rabbitmq/apps/notification-service/src/main.ts#L19

But I am not sure how to implement DLQ and retry logic in my nestjs app or are they're implemented already out of the box for me?

For example I have this event-based microservice communication and all I am doing right now is just acknowledging the event after successful email sending: https://github.com/kasir-barati/nestjs-materials/blob/main/microservices/complex-reservation-rabbitmq/apps/notification-service/src/notification-service.controller.ts#L24

I appriciate any kind of resource or materials that I can read/watch/listen to figure this our.

dusk plaza
#

Hey folks

I have implemented it but I am in need of some inputs.

  1. IDK if the way I broached the subject is appropriate and good.
  2. IDK how to test the whole thing. I mean I can throw some errors in the code randomly but I am not sure if that is how you'll do it in a professional work env.

For example I could throw an error (throw "random error") here: https://github.com/kasir-barati/nestjs-materials/blob/main/microservices/complex-reservation-rabbitmq/apps/notification-service/src/notification-service.service.ts#L26

But I am not sure if that is how I should do it.

#

I am just thinking of having some automated e2e tests so that I could rerun them indefinitely

#

Any comment?

I have already some e2e tests for other endpoints but none for these kind of things.