Expand description
Helpers for working with Kafka’s client API.
Structs§
- Broker
Addr - The address of a Kafka broker.
- Broker
Rewrite - Rewrites a broker address.
- MzClient
Context - A
ClientContext
implementation that usestracing
instead oflog
macros. - Timeout
Config - Configurable timeouts for Kafka connections.
- Tunneling
Client Context - A client context that supports rewriting broker addresses.
Enums§
- Broker
Rewrite 🔒Handle - GetPartitions
Error - The error returned by
get_partitions
. - MzKafka
Error - A structured error type for errors reported by librdkafka through its logs.
- Tunnel
Config - Tunneling clients used for re-writing ports / hosts
Constants§
- DEFAULT_
FETCH_ METADATA_ TIMEOUT - A reasonable default timeout when fetching metadata or partitions.
- DEFAULT_
KEEPALIVE - Default to true as they have no downsides https://github.com/confluentinc/librdkafka/issues/283.
- DEFAULT_
PROGRESS_ RECORD_ FETCH_ TIMEOUT - The timeout for reading records from the progress topic. Set to something slightly longer than the idle transaction timeout (60s) to wait out any stuck producers.
- DEFAULT_
SOCKET_ CONNECTION_ SETUP_ TIMEOUT - The
rdkafka
default. - DEFAULT_
SOCKET_ TIMEOUT - The
rdkafka
default. - DEFAULT_
TOPIC_ METADATA_ REFRESH_ INTERVAL - A reasonable default timeout when refreshing topic metadata. This is configured at a source level.
- DEFAULT_
TRANSACTION_ TIMEOUT - Increased from the rdkafka default
Functions§
- create_
new_ client_ config - Build a new
rdkafka
ClientConfig
with itslog_level
set correctly based on the passed throughtracing::Level
. This level should be determined fortarget: "librdkafka"
. - create_
new_ client_ config_ simple - A simpler version of
create_new_client_config
that defaults thelog_level
toINFO
and should only be used in tests. - get_
partitions - Retrieve number of partitions for a given
topic
using the givenclient
Type Aliases§
- Partition
Id - Id of a partition in a topic.