consumer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitKafkaConsumer

func InitKafkaConsumer()

func SetConsumerOption

func SetConsumerOption(cfg *model.KafkaConsumerConfig, opts *ConsumerOptions) error

func SetReturnTopicOption

func SetReturnTopicOption(tag string, opts *ConsumerOptions) error

Types

type ConsumerOptions

type ConsumerOptions struct {
	BrokerAddresses []string
	Topics          []string
	GroupID         string
	Version         string

	Cfg *sarama.Config
}

func NewConsumerOptions

func NewConsumerOptions() *ConsumerOptions

type IHandler

type IHandler interface {
	HandleMessage(message *sarama.ConsumerMessage) error
}

type SimConsumerGroup

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

func NewSimConsumerGroup

func NewSimConsumerGroup(opts *ConsumerOptions) *SimConsumerGroup

func (*SimConsumerGroup) Cleanup

func (*SimConsumerGroup) ConsumeClaim

func (scg *SimConsumerGroup) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

func (*SimConsumerGroup) DealErrors

func (scg *SimConsumerGroup) DealErrors()

func (*SimConsumerGroup) HandleLoop

func (scg *SimConsumerGroup) HandleLoop()

func (*SimConsumerGroup) SetHandler

func (scg *SimConsumerGroup) SetHandler(handler IHandler)

func (*SimConsumerGroup) Setup

func (*SimConsumerGroup) Start

func (scg *SimConsumerGroup) Start() error

func (*SimConsumerGroup) Stop

func (scg *SimConsumerGroup) Stop()

Jump to

Keyboard shortcuts

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