View definition

func NewHashPartitioner

Defined in github.com/Shopify/sarama/partitioner.go

Description

NewHashPartitioner returns a Partitioner which behaves as follows. If the message's key is nil then a random partition is chosen. Otherwise the FNV-1a hash of the encoded bytes of the message key is used, modulus the number of partitions. This ensures that messages with the same key always end up on the same partition.

NewHashPartitioner is referenced in 12 repositories

github.com/Shopify/sarama github.com/funkygao/gafka github.com/ECLabs/Eaton-Feeder

...