kafka

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UseFunctionWithTimeoutError = errors.New("handler timeout")

Functions

func InitTopic

func InitTopic(bootstrapUrl string, topics ...string) (err error)

func NewConsumer

func NewConsumer(ctx context.Context, broker string, groupId string, topic string, listener func(delivery []byte) error, errhandler func(err error)) error

func NewConsumerWithMultipleTopics

func NewConsumerWithMultipleTopics(ctx context.Context, broker string, groupId string, topics []string, debug bool, listener func(topic string, delivery []byte) error, errhandler func(topice string, err error)) error

Types

type KeySeparationBalancer

type KeySeparationBalancer struct {
	SubBalancer kafka.Balancer
	Seperator   string
}

func (*KeySeparationBalancer) Balance

func (this *KeySeparationBalancer) Balance(msg kafka.Message, partitions ...int) (partition int)

type Producer

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

func NewProducer

func NewProducer(ctx context.Context, bootstrapUrl string, topic string, debug bool) (*Producer, error)

func NewProducerWithBalancer

func NewProducerWithBalancer(ctx context.Context, broker string, topic string, debug bool, balancer kafka.Balancer) (*Producer, error)

func NewProducerWithKeySeparationBalancer

func NewProducerWithKeySeparationBalancer(ctx context.Context, bootstrapUrl string, topic string, debug bool) (*Producer, error)

func (*Producer) Produce

func (this *Producer) Produce(key string, message []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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