NestJS · Senior · Question 70 of 75
How can Nest consume messages from a broker it has no built-in transport for, like AWS SQS?
- 1Poll the broker from a controller
- 2It's impossible; only built-in transports work
- ✓Correct answer: Write a custom transporter implementing
CustomTransportStrategy(server) and a matching client, then use@MessagePattern/@EventPatternas usual
Explanation
Community packages exist for SQS, Pub/Sub and others. A custom strategy keeps handler code transport-agnostic.