- Producers can choose to send a key with the message (string, number, etc..)
- If key = null, data is sent reound robin (broker 101 then 102 then 103...)
- If a key is sent, then all messages for that key will always go to the same partition
- A key is basically sent if you need message ordering for a specific field(ex:truck_id)
(Advanced: we get this guarantee thanks to key hashing, which depends on the number of partitions)
댓글 없음:
댓글 쓰기