sarama

package
v0.0.0-...-0909f30 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Channel to detect when the client is do with the process.
	Done = make(chan bool)
)

Functions

func NewProducer

func NewProducer(brokers string) sarama.AsyncProducer

NewProducer returns a new Sarama async producer.

func Prepare

func Prepare(producer sarama.AsyncProducer, message []byte, numMessages int) func()

Prepare returns a function that can be used during the benchmark as it only performs the sending of messages, checking that the sending was successful.

func PrepareConsume

func PrepareConsume(consumer *Consumer) func()

PrepareConsume returns a function that can be used during the benchmark as it only performs the consuming of messages.

Types

type Consumer

type Consumer struct {
	Client sarama.ConsumerGroup

	Ready chan bool
	// contains filtered or unexported fields
}

Consumer represents a Sarama consumer group consumer

func NewConsumer

func NewConsumer(brokers string, numMessages int) *Consumer

NewConsumer returns a new sarama consumer.

func (*Consumer) Cleanup

func (consumer *Consumer) Cleanup(sarama.ConsumerGroupSession) error

Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited

func (*Consumer) ConsumeClaim

func (consumer *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

ConsumeClaim must start a consumer loop of ConsumerGroupClaim's Messages().

func (*Consumer) Setup

func (consumer *Consumer) Setup(sarama.ConsumerGroupSession) error

Setup is run at the beginning of a new session, before ConsumeClaim

Jump to

Keyboard shortcuts

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