consumer

package
v0.0.0-...-c72c156 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchConsumerConfig

type BatchConsumerConfig struct {
	BufferCapacity        int // msg capacity
	MaxBufSize            int // max message size
	TickerIntervalSeconds int
	Callback              func([]*ConsumerSessionMessage) error
}

type ConsumerGroup

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

func NewConsumerGroup

func NewConsumerGroup(broker string, topics []string, group string, handler ConsumerGroupHandler) (*ConsumerGroup, error)

func StartBatchConsumer

func StartBatchConsumer(broker, topic string) (*ConsumerGroup, error)

func StartMultiAsyncConsumer

func StartMultiAsyncConsumer(broker, topic string) (*ConsumerGroup, error)

func StartMultiBatchConsumer

func StartMultiBatchConsumer(broker, topic string) (*ConsumerGroup, error)

func StartSyncConsumer

func StartSyncConsumer(broker, topic string) (*ConsumerGroup, error)

func (*ConsumerGroup) Close

func (c *ConsumerGroup) Close() error

type ConsumerGroupHandler

type ConsumerGroupHandler interface {
	sarama.ConsumerGroupHandler
	WaitReady()
	Reset()
}

func NewBatchConsumerGroupHandler

func NewBatchConsumerGroupHandler(cfg *BatchConsumerConfig) ConsumerGroupHandler

func NewMultiAsyncConsumerGroupHandler

func NewMultiAsyncConsumerGroupHandler(cfg *MultiAsyncConsumerConfig) ConsumerGroupHandler

func NewMultiBatchConsumerGroupHandler

func NewMultiBatchConsumerGroupHandler(cfg *MultiBatchConsumerConfig) ConsumerGroupHandler

func NewSyncConsumerGroupHandler

func NewSyncConsumerGroupHandler(cb func([]byte) error) ConsumerGroupHandler

type ConsumerSessionMessage

type ConsumerSessionMessage struct {
	Session sarama.ConsumerGroupSession
	Message *sarama.ConsumerMessage
}

type MultiAsyncConsumerConfig

type MultiAsyncConsumerConfig struct {
	BufChan chan *ConsumerSessionMessage
}

type MultiBatchConsumerConfig

type MultiBatchConsumerConfig struct {
	BufferCapacity        int // msg capacity
	MaxBufSize            int // max message size
	TickerIntervalSeconds int

	BufChan chan batchMessages
}

Jump to

Keyboard shortcuts

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