View Source KafkaEx.Partitioner behaviour (kafka_ex v0.14.0)
Behaviour definition for partitioners, that assigns partitions for requests.
Summary
Functions
Returns key for given messages
Callbacks
@callback assign_partition( request :: KafkaEx.Protocol.Produce.Request.t(), metadata :: KafkaEx.Protocol.Metadata.Response.t() ) :: KafkaEx.Protocol.Produce.Request.t()
Functions
@spec get_key(request :: KafkaEx.Protocol.Produce.Request.t()) :: {:ok, nil | binary()} | {:error, atom()}
Returns key for given messages
Function looks for message key in messages list of {ProduceRequest}. It may return
either {:ok, nil}
if no key was found, {:ok, key}
when key was found,
or {:error, atom}
when error happens while looking for the key.