kafka

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GroupReceive added in v1.2.0

func GroupReceive(consumerGroup sarama.ConsumerGroup, topics []string, handle func(message *sarama.ConsumerMessage) error) error

func NewSyncConsumer

func NewSyncConsumer(addresses []string, user string, password string) (sarama.Consumer, error)

func NewSyncConsumerGroup

func NewSyncConsumerGroup(addresses []string, groupID, user string, password string) (sarama.ConsumerGroup, error)

func NewSyncProducer

func NewSyncProducer(addresses []string, user string, password string) (sarama.SyncProducer, error)

func Receive

func Receive(consumer sarama.Consumer, topic string, handle func(msg *sarama.ConsumerMessage)) error

func Send

func Send(msg *sarama.ProducerMessage, producer sarama.SyncProducer) error

func SendB added in v1.2.0

func SendB(b []byte, topic string, producer sarama.SyncProducer) error

func SendT

func SendT(t any, topic string, producer sarama.SyncProducer) error

Types

type ConsumerGroupHandler

type ConsumerGroupHandler struct {
	//sarama.ConsumerGroupHandler
	Handle func(msg *sarama.ConsumerMessage) error
}

func (*ConsumerGroupHandler) Cleanup

Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited

func (*ConsumerGroupHandler) ConsumeClaim

func (handler *ConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

ConsumeClaim must start a consumer loop of ConsumerGroupClaim's Messages().

func (*ConsumerGroupHandler) Setup

Jump to

Keyboard shortcuts

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