producer

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 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 interface {
	//Send sends a message to Kafka and returns an error if it fails.
	Send(topic string, key []byte, value []byte) error
	// SendAsync sends a message to Kafka asynchronously and returns an error if it fails.
	SendAsync(topic string, key []byte, value []byte) error
	// Close closes the producer.
	Close() error
}

Producer interface defines the methods that can be used to produce messages to Kafka.

func NewProducer

func NewProducer(brokers []string, topic string, config *types.Config) (Producer, error)

NewProducer returns a new instance of a Kafka producer.

Jump to

Keyboard shortcuts

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