db2kafka v0.1.0 Db2Kafka.TopicHealthTracker

This module contains a GenServer that can be used to track per-topic health. When writing to Kafka, the result of the operation can be sent here through the report_partition_ok and report_partition_error messages (which are processed async). The GenServer keeps track of partitions across a topic, and whenever a state is reached that no partitions are reported healthy, the process will kill itself.

Used in a supervisor hierarchy, this should trigger a reset of the Kafka client which may help in fixing the underlying issue by reconnecting, etcetera.

Summary

Types

t()
t() :: %Db2Kafka.TopicHealthTracker{partitions_status: %{optional(non_neg_integer) => non_neg_integer}, topic: String.t}

Functions

report_partition_error(topic, partition)
report_partition_error(String.t, non_neg_integer) :: :ok
report_partition_ok(topic, partition)
report_partition_ok(String.t, non_neg_integer) :: :ok
start_link(topic, num_partitions)
start_link(String.t, non_neg_integer) :: GenServer.on_start