producer

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Producer

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

Producer struct wraps a sarama.AsyncProducer and handles Kafka message production.

func NewProducer

func NewProducer(brokers []string) (*Producer, error)

NewProducer creates a new Producer with the given Kafka brokers.

func (*Producer) Close

func (p *Producer) Close() error

Close stops the producer and returns any errors during closure.

func (*Producer) GetProducedMessages

func (p *Producer) GetProducedMessages() (uint64, uint64)

GetProducedMessages returns the count of produced and errored messages.

func (*Producer) SendMessage

func (p *Producer) SendMessage(message *shared.KafkaMessage)

SendMessage sends a KafkaMessage to the producer.

Jump to

Keyboard shortcuts

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