MCPcopy
hub / github.com/IBM/sarama / NewRoundRobinPartitioner

Function NewRoundRobinPartitioner

partitioner.go:118–120  ·  view source on GitHub ↗

NewRoundRobinPartitioner returns a Partitioner which walks through the available partitions one at a time.

(topic string)

Source from the content-addressed store, hash-verified

116
117// NewRoundRobinPartitioner returns a Partitioner which walks through the available partitions one at a time.
118func NewRoundRobinPartitioner(topic string) Partitioner {
119 return &roundRobinPartitioner{}
120}
121
122func (p *roundRobinPartitioner) Partition(message *ProducerMessage, numPartitions int32) (int32, error) {
123 if p.partition >= numPartitions {

Callers 2

Calls

no outgoing calls

Tested by 2