View Source KafkaEx.DefaultPartitioner (kafka_ex v0.14.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.

Summary

Functions

Link to this function

assign_partition(request, metadata)

View Source
@spec assign_partition(
  request :: KafkaEx.Protocol.Produce.Request.t(),
  metadata :: KafkaEx.Protocol.Metadata.Response.t()
) :: KafkaEx.Protocol.Produce.Request.t()

Callback implementation for KafkaEx.Partitioner.assign_partition/2.