kafkaexporter

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter struct {
	// Format is the output format for the message value.
	// The only available format right now is JSON, and this field provided for future usage.
	// Default: JSON
	Format string

	// Settings contains the Kafka producer's configuration. The Topic and Addresses fields are required. If
	// no sarama.Config is provided a sensible default will be used.
	Settings Settings
	// contains filtered or unexported fields
}

Exporter sends events to a Kafka topic using a synchronous producer

func (*Exporter) Export

func (e *Exporter) Export(_ context.Context, _ *fflog.FFLogger, featureEvents []exporter.FeatureEvent) error

Export will produce a message to the Kafka topic. The message's value will contain the event encoded in the selected format. Messages are published synchronously and will error immediately on failure.

func (*Exporter) IsBulk

func (e *Exporter) IsBulk() bool

IsBulk reports if the producer can handle bulk messages. Will always return false for this exporter.

type MessageSender

type MessageSender interface {
	SendMessages(msgs []*sarama.ProducerMessage) error
}

MessageSender is a Kafka producer that implements the SendMessages method

type Settings

type Settings struct {
	Topic     string   `json:"topic"`
	Addresses []string `json:"addresses"`
	*sarama.Config
}

Settings contains Kafka-specific configurations needed for message creation

Jump to

Keyboard shortcuts

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