producer

package
v1.1.53 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch added in v0.0.65

type Batch struct {
	Writer *kafka.Writer
	// contains filtered or unexported fields
}

func (*Batch) AddMessages added in v0.0.65

func (b *Batch) AddMessages(ctx *models.ListenerContext, messages []kafka.Message, eventTime time.Time, isLastChunk bool)

func (*Batch) Close added in v0.0.65

func (b *Batch) Close()

func (*Batch) FlushMessages added in v0.0.65

func (b *Batch) FlushMessages()

func (*Batch) PrepareEndRebalancing added in v0.0.65

func (b *Batch) PrepareEndRebalancing()

func (*Batch) PrepareStartRebalancing added in v0.0.65

func (b *Batch) PrepareStartRebalancing()

func (*Batch) StartBatchTicker added in v0.0.65

func (b *Batch) StartBatchTicker()

type Metric

type Metric struct {
	KafkaConnectorLatency int64
	BatchProduceLatency   int64
}

type Producer

type Producer struct {
	ProducerBatch *Batch
}

func NewProducer

func NewProducer(kafkaClient gKafka.Client,
	config *config.Connector,
	dcpCheckpointCommit func(),
	sinkResponseHandler gKafka.SinkResponseHandler,
) (Producer, error)

func (*Producer) Close

func (p *Producer) Close() error

func (*Producer) GetMetric

func (p *Producer) GetMetric() *Metric

func (*Producer) Produce

func (p *Producer) Produce(
	ctx *models.ListenerContext,
	eventTime time.Time,
	messages []kafka.Message,
	isLastChunk bool,
)

func (*Producer) StartBatch

func (p *Producer) StartBatch()

Jump to

Keyboard shortcuts

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