producer

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewProducerWrapper = func(configMap *kafka.ConfigMap) (ProducerInterface, error) {
	return kafka.NewProducer(configMap)
}

Kafka Function Reference Variable To Facilitate Mocking In Unit Tests

Functions

This section is empty.

Types

type ProducerInterface

type ProducerInterface interface {
	String() string
	Produce(msg *kafka.Message, deliveryChan chan kafka.Event) error
	Events() chan kafka.Event
	ProduceChannel() chan *kafka.Message
	Len() int
	Flush(timeoutMs int) int
	Close()
}

Confluent Client Doesn't Code To Interfaces Or Provide Mocks So We're Wrapping Our Usage Of The Producer For Testing

func CreateProducer

func CreateProducer(brokers string, username string, password string) (ProducerInterface, error)

Create A Kafka Producer (Optional Authentication)

Jump to

Keyboard shortcuts

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