consumer

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TopicFromContext

func TopicFromContext(ctx context.Context) (string, bool)

Types

type CfgOption

type CfgOption func(config *sarama.Config)

func FromNewest

func FromNewest() CfgOption

type Consumer

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

func New

func New(kafkaBrokers []string, consumerGroupID string, topics []string, cfgOptions ...CfgOption) (*Consumer, error)

func (*Consumer) AddFallback

func (c *Consumer) AddFallback(fn FallbackFunc)

func (*Consumer) AddHandler

func (c *Consumer) AddHandler(messageType string, handler handler.Handler)

func (*Consumer) HealthCheck

func (c *Consumer) HealthCheck(_ context.Context) bool

func (*Consumer) Start

func (c *Consumer) Start(ctx context.Context) error

type FallbackFunc

type FallbackFunc func(context.Context, []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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