kafka

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 4 Imported by: 0

README

kafka

Documentation

Index

Constants

View Source
const DefaultProducerMessageMaxBytes = 10 << 20 // 10M

Variables

This section is empty.

Functions

func NewConsumer

func NewConsumer(addresses []string) (sarama.Consumer, error)

Types

type Consumer

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

func NewPartitionConsumer

func NewPartitionConsumer(addresses []string, topic string,
	partition int32, offset int64) (Consumer, error)

func (Consumer) Close

func (c Consumer) Close()

Close the producer

func (Consumer) Errors

func (c Consumer) Errors() <-chan *sarama.ConsumerError

Get consumer error channel

func (Consumer) Messages

func (c Consumer) Messages() <-chan *sarama.ConsumerMessage

Consume a single message, block if no message in queue

type Producer

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

func NewProducer

func NewProducer(addresses []string, topic string) (Producer, error)

func (Producer) Close

func (p Producer) Close()

Close the producer

func (Producer) Errors

func (p Producer) Errors() <-chan *sarama.ProducerError

Get producer error channel

func (Producer) Publish

func (p Producer) Publish(partitionKey string, message []byte)

Publish publishes message

func (Producer) Republish

func (p Producer) Republish(msg *sarama.ProducerMessage)

Simplify republishing messages from error channel

Jump to

Keyboard shortcuts

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