kafka

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTopic

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

func InitTopicWithPartitionNumber

func InitTopicWithPartitionNumber(bootstrapUrl string, partitionNumber int, topics ...string) (err error)

func NewConsumer

func NewConsumer(ctx context.Context, config configuration.Config, topic string, listener func(delivery []byte) error) error

func NewConsumerWithFullMessage

func NewConsumerWithFullMessage(ctx context.Context, config configuration.Config, topic string, listener func(delivery kafka.Message) 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, config configuration.Config, topic string) (*Producer, error)

func NewProducerWithBalancer

func NewProducerWithBalancer(ctx context.Context, config configuration.Config, topic string, balancer kafka.Balancer) (*Producer, error)

func NewProducerWithKeySeparationBalancer

func NewProducerWithKeySeparationBalancer(ctx context.Context, config configuration.Config, topic string) (*Producer, error)

func (*Producer) Produce

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

Jump to

Keyboard shortcuts

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