KafkaBatcher.Behaviours.Producer behaviour (kafka_batcher v1.0.0)

KafkaBatcher.Behaviours.Producer adds an abstraction level over producer implementations in various Kafka libs. Defines the callbacks that a Kafka producer should implement

Summary

Types

@type event() :: KafkaBatcher.MessageObject.t()
@type events() :: [event()]

Callbacks

Link to this callback

do_produce(events, topic, partition, config)

@callback do_produce(
  events :: events(),
  topic :: binary(),
  partition :: non_neg_integer() | nil,
  config :: Keyword.t()
) :: :ok | {:error, binary() | atom()}
Link to this callback

get_partitions_count(binary)

@callback get_partitions_count(binary()) :: {:ok, integer()} | {:error, binary() | atom()}
@callback start_client() :: {:ok, pid()} | {:error, any()}
Link to this callback

start_producer(binary, t)

@callback start_producer(binary(), Keyword.t()) :: :ok | {:error, any()}