producer

package
v0.33.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 21 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

func NewProducer

func NewProducer(logger *zap.Logger,
	config *sarama.Config,
	brokers []string,
	statsReporter metrics.StatsReporter,
	healthServer *health.Server) (*Producer, error)

NewProducer returns a new Producer instance with specified configuration.

func (*Producer) Close

func (p *Producer) Close()

Close gracefully stops all Producer processing.

func (*Producer) ObserveMetrics

func (p *Producer) ObserveMetrics(interval time.Duration)

ObserveMetrics is an async process for observing Kafka metrics.

func (*Producer) ProduceKafkaMessage

func (p *Producer) ProduceKafkaMessage(ctx context.Context, channelReference eventingChannel.ChannelReference, message binding.Message, httpHeader http.Header, transformers ...binding.Transformer) error

ProduceKafkaMessage creates and sends a Sarama ProducerMessage to the specified Topic and waits for the delivery confirmation.

func (*Producer) SecretChanged added in v0.21.0

func (p *Producer) SecretChanged(ctx context.Context, secret *corev1.Secret) *Producer

SecretChanged is called by the secretObserver handler function in main() so that settings specific to the producer may be extracted and the producer restarted if necessary.

Jump to

Keyboard shortcuts

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