Binding là quy tắc kết nối exchange với queue, xác định khi nào message được định tuyến từ exchange đến queue đó.
- Binding dùng một
routing_key(chuỗi string) làm tiêu chí so khớp — ví dụ: bind queue "orders" vào exchange "direct" với routing_key "new_order", thì chỉ message có routing_key đó mới vào queue này. - Không có binding, exchange không biết gửi message đi đâu.
A binding is a rule connecting an exchange to a queue, specifying which messages get routed there.
- Bindings use a
routing_keystring as matching criteria — for example, binding a "orders" queue to a "direct" exchange with routing_key "new_order" means only messages with that key reach that queue. - Without bindings, exchanges have no queues to deliver to.