Documentation ¶
Overview ¶
Package kafka provides a simple high-level API for producing and consuming Apache Kafka messages. It abstracts away the complexities of the Kafka protocol and provides a simplified interface for working with Kafka topics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer represents a wrapper around kafka.Consumer.
func NewConsumer ¶
NewConsumer creates a new instance of Consumer. Please call the HealthCheck() method to check if the connection is working.
func (*Consumer) HealthCheck ¶
HealthCheck checks if the consumer is working.
type Option ¶
type Option func(*config)
Option is a type alias for a function that configures Kafka client.
func WithFirstOffset ¶
func WithFirstOffset() Option
WithFirstOffset tells Kafka consumer to read from the beginning of uncommitted offset. By default it will read from the end of the queue.
func WithSessionTimeout ¶
WithSessionTimeout sets the timeout used to detect client failures when using Kafka's group management facility. The client sends periodic heartbeats to indicate its liveness to the broker. If no heartbeats are received by the broker before the expiration of this session timeout, then the broker will remove this client from the group and initiate a rebalance.