Murmur2Balancer is a Balancer that uses the Murmur2 hash function to determine which partition to route messages to. This ensures that messages with the same key are routed to the same partition. This balancer is compatible with the partitioner used by the Java library and by librdkafka's "murmur2
| 291 | // keys. We choose librdkafka's implementation because it arguably has a larger |
| 292 | // install base. |
| 293 | type Murmur2Balancer struct { |
| 294 | Consistent bool |
| 295 | random randomBalancer |
| 296 | } |
| 297 | |
| 298 | func (b Murmur2Balancer) Balance(msg Message, partitions ...int) (partition int) { |
| 299 | // NOTE: the murmur2 balancers in java and librdkafka treat a nil key as |
nothing calls this directly
no outgoing calls
no test coverage detected