kafka

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxMessageSizeLimit = 987 // to make sure that the message size is below 1 MB.

)

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaProducerConfig

type KafkaProducerConfig struct {
	ProducerID     string
	ProducerTopic  string
	MsgSizeLimitKB int
}

type Producer

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

Producer abstracts hub-of-hubs-kafka-transport kafka-producer's generic usage.

func NewProducer

func NewProducer(compressor compressor.Compressor, bootstrapServer string, producerConfig *KafkaProducerConfig, log logr.Logger) (*Producer, error)

NewProducer returns a new instance of Producer object.

func (*Producer) SendAsync

func (p *Producer) SendAsync(destinationHubName string, id string, msgType string, version string, payload []byte)

SendAsync sends a message to the sync service asynchronously.

func (*Producer) Start

func (p *Producer) Start()

Start starts kafka producer.

func (*Producer) Stop

func (p *Producer) Stop()

Stop stops the producer.

Jump to

Keyboard shortcuts

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