simple

package module
v0.0.0-...-8c4d5dc Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetDefaultProducerConfig

func GetDefaultProducerConfig(maxRetry int) *sarama.Config

func NewConsumerGroup

func NewConsumerGroup(ver string, groupId string, assignor string, brokerList ...string) (sarama.ConsumerGroup, error)

func NewProducer

func NewProducer(maxRetry int, brokerList ...string) (sarama.SyncProducer, error)

Types

type Admin

type Admin struct {
	sarama.ClusterAdmin
}

func NewClusterAdmin

func NewClusterAdmin(ver string, brokerList ...string) (*Admin, error)

func (*Admin) FindTopic

func (a *Admin) FindTopic(topic string) (bool, error)

func (*Admin) NewTopic

func (a *Admin) NewTopic(topic string, numPartitions int32, replicationFactor int16) error

type Consumer

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

Consumer represents a Sarama consumer group consumer

func NewConsumer

func NewConsumer() Consumer

func (*Consumer) Cleanup

func (consumer *Consumer) Cleanup(sarama.ConsumerGroupSession) error

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

func (*Consumer) ConsumeClaim

func (consumer *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

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

func (*Consumer) Setup

func (consumer *Consumer) Setup(sarama.ConsumerGroupSession) error

Setup is run at the beginning of a new session, before ConsumeClaim

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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