intermediate

Exchange

Route published messages в queues через direct, topic, fanout или header rules вместо direct sending producers to queues.

В AMQP-style brokers exchanges маршрутизируют published messages в queues по правилам: direct (exact routing key), topic (pattern match), fanout (все bound queues), headers. Producers публикуют в exchanges, не напрямую в queues — decoupling routing от producers.

Компромисс: гибкий routing против configuration complexity и сложнее tracing путей сообщений.

На интервью: routing для priority orders vs standard orders через topic exchange bindings.

Типовые ошибки: orphan bindings; typos routing key — silent drop; fanout дублирует work без idempotent consumers.

Чеклист:

  • Диаграмма exchange type и bindings per use case.
  • Validate routing keys в CI или schema tests.
  • Мониторьте unroutable message drops.
  • Ownership bindings per team.