consumer

package
v0.0.0-...-b17de50 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(message *sarama.ConsumerMessage, logger *log.Entry) (retry bool, err error)

type Config

type Config struct {
	Brokers           []string
	Callback          Callback
	GroupID           string
	MaxProcessingTime time.Duration
	Logger            *log.Logger
	RetryInterval     time.Duration
	TlsConfig         *tls.Config
	Topic             string
}

type Consumer

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

func New

func New(cfg Config) (*Consumer, error)

func (*Consumer) Cleanup

func (c *Consumer) Cleanup(_ sarama.ConsumerGroupSession) error

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

func (*Consumer) ConsumeClaim

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

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

func (*Consumer) Setup

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