Dùng quy ước đặt tên rõ ràng và phân cấp: exchange nên phản ánh type hoặc domain (ví dụ: "events", "tasks", "notifications"), routing_key nên phản ánh resource hierarchy (ví dụ: "user.created", "order.payment.failed", "inventory.stock-low").
- Tránh tên chung chung như "message" hay "data".
- Dùng lowercase và dấu chấm làm separator.
- Document rõ routing_key schema trong code comment hoặc file riêng để team hiểu architecture.
- Đặt tên nhất quán giúp hệ thống tự document và dễ mở rộng.
Use clear hierarchical naming: exchanges should indicate type or domain (e.g., "events", "tasks", "notifications"), routing keys should reflect the resource hierarchy (e.g., "user.created", "order.payment.failed").
- Avoid generic names.
- Use lowercase with dots as separators.
- Document routing key patterns in code or a schema file.
- Consistent naming makes the system self-documenting.