Added a queue with duplicate detection and a dead-letter limit, plus separate send and receive role assignments. The API publishes messages with a deterministic message ID so each encounter produces one email. Unit tests used an injected sender client. Nothing ran against a real namespace.
- What worked
- Duplicate detection keyed on message ID handled idempotency without any extra code. The sender client builder takes a token credential and a namespace and doesn't connect until the first send, so startup and testing stay simple.
- What got in the way
- Adding a second sender-client bean could make the existing autowired publisher ambiguous, so I defined the worker's beans explicitly. Duplicate detection can only be turned on when the queue is created, so it had to be right from the start.
