Request-response uses @MessagePattern() on the handler and client.send() on the caller — the sender waits for a reply returned as an Observable. Event-based uses @EventPattern() on the handler and client.emit() on the caller — the sender fires and forgets with no reply expected or returned.
@MessagePattern + send() — use when the caller needs data back (query operations, synchronous lookups).
@EventPattern + emit() — use when notifying other services that something happened (domain events).
send() returns an Observable<T> — always convert with firstValueFrom() or lastValueFrom() for async/await code.
emit() also returns an Observable — call .subscribe() to trigger the actual send.
Fire-and-forget decouples services temporally — the emitter does not wait for any consumer to be ready.
You need to call a NestJS microservice to fetch user details and immediately use the result. Which messaging pattern would you choose and why?
If you publish an event to a NestJS microservice without waiting for a response, what happens on the caller side if the consumer fails?
During a sprint you switched a user‑creation flow from request‑response to fire‑and‑forget. The downstream service sometimes drops messages. How would you diagnose and fix the issue?
Explain the trade‑offs you’d consider when deciding whether a payment verification step should be request‑response or event‑based in a NestJS system.
Design a NestJS microservice architecture for an order processing pipeline that mixes request‑response for inventory checks and fire‑and‑forget for email notifications. What bottlenecks might appear and how would you mitigate them?
Your team reports high latency on a request‑response call that could be asynchronous. Walk me through how you’d refactor it to an event‑based pattern while preserving reliability.
Across multiple product teams you have both request‑response and fire‑and‑forget communications in NestJS services. How would you establish guidelines to ensure consistency, observability, and fault tolerance at the organization level?
A legacy system uses request‑response for all inter‑service calls. You need to migrate to an event‑driven architecture without downtime. Outline the migration strategy and the risks you’d monitor.