producer

package
v0.0.0-...-a6f2505 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 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 Config

type Config struct {
	Idempotence      bool
	ReadEvents       bool
	FlushTimeoutMs   int
	BootstrapServers string
	SSL              SSLConfig
}

type Producer

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

func New

func New(ctx context.Context, wg *sync.WaitGroup, topic string, config Config) (*Producer, error)

func (*Producer) HealthCheck

func (p *Producer) HealthCheck() error

func (*Producer) Produce

func (p *Producer) Produce(key, value []byte) error

It is an example of how we can implement the message send to Kafka topic. Feel free to change this implementation if you need to add more options like headers, timestamp, partition etc.

func (*Producer) ProduceSync

func (p *Producer) ProduceSync(key, value []byte) error

The same as Produce but imitates synchronous send

type SSLConfig

type SSLConfig struct {
	Enabled             bool
	KeyLocation         string
	CertificateLocation string
	CALocation          string
}

Jump to

Keyboard shortcuts

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