Use Transport.RMQ in both NestFactory.createMicroservice() and ClientsModule.register(). Set noAck: false for manual acknowledgement so messages are not lost if the consumer crashes. Set prefetchCount to control concurrency and queueOptions.durable: true so messages survive RabbitMQ restarts.
noAck: false — enables manual acknowledgement; the handler must ack/nack via RmqContext.
prefetchCount — controls concurrency; limits how many unacknowledged messages a consumer holds at once.
durable: true on the queue ensures messages survive RabbitMQ broker restarts.
urls accepts an array — amqp-connection-manager round-robins and reconnects automatically.
Use persistent message delivery (deliveryMode: 2) on the publisher side for full durability.
Walk me through the code you'd write to set up a NestJS microservice that listens to a RabbitMQ queue named 'orders'.
If the RabbitMQ server is down when the service starts, what will happen and how would you make the service fail gracefully?
You notice that messages are being lost when the consumer crashes. How would you modify your NestJS RabbitMQ setup to prevent loss?
Explain why your microservice started throwing a 'Connection reset by peer' error after a recent config change, and how you'd debug it.
Design a strategy for handling high‑throughput order events across multiple NestJS microservices using RabbitMQ, addressing backpressure and scaling.
How would you implement dead‑letter queues and retry policies in NestJS to ensure problematic messages are isolated?
Your organization wants to migrate from a legacy RabbitMQ cluster to a multi‑region, highly available setup. How would you evolve the NestJS microservice architecture to support this without downtime?
Discuss the trade‑offs of using RabbitMQ versus a streaming platform like Kafka for inter‑service communication in a large NestJS codebase, and how you'd guide the team in making a decision.