View Source KafkaEx.DefaultPartitioner (kafka_ex v0.13.0)
Default partitioner implementation.
When message key is set and partition isn't, partition is decided based on murmur2 hash of a key to provide Java implementation consistency. When message key and partition is missing, partition is selected randomly. When partition is provided nothing changes.
Link to this section Summary
Functions
Callback implementation for KafkaEx.Partitioner.assign_partition/2
.
Link to this section Functions
@spec assign_partition( request :: %KafkaEx.Protocol.Produce.Request{ api_version: term(), compression: term(), messages: term(), partition: term(), required_acks: term(), timeout: term(), topic: term() }, metadata :: %KafkaEx.Protocol.Metadata.Response{ brokers: term(), controller_id: term(), topic_metadatas: term() } ) :: %KafkaEx.Protocol.Produce.Request{ api_version: term(), compression: term(), messages: term(), partition: term(), required_acks: term(), timeout: term(), topic: term() }
Callback implementation for KafkaEx.Partitioner.assign_partition/2
.