kafkaclient

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaClient

type KafkaClient struct {
	// contains filtered or unexported fields
}

func NewKafkaClient

func NewKafkaClient(broker string, maxRetries int, retryInterval time.Duration, config *sarama.Config) (*KafkaClient, error)

NewKafkaClient creates a new KafkaClient instance.

func (*KafkaClient) Close

func (kc *KafkaClient) Close() error

Close closes the connection to Kafka.

func (*KafkaClient) IsReady

func (kc *KafkaClient) IsReady() bool

IsReady returns the readiness state of the Kafka client.

func (*KafkaClient) SendBatch

func (kc *KafkaClient) SendBatch(batch []*sarama.ProducerMessage, topic string) error

SendBatch sends a batch of messages to Kafka with retries.

func (*KafkaClient) StartBatchSender

func (kc *KafkaClient) StartBatchSender(ringBuffer *kafkabuff.RingBuffer, batchSize int, interval time.Duration, kafkaTopic string)

StartBatchSender starts sending messages from the ring buffer to Kafka.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL