trs_kafka

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSendReceiveConsumerGroupName

func GenerateSendReceiveConsumerGroupName(appName, workerClass, consumerGroup string) (sendTopic string, rcvTopic string, cgroupName string)

Types

type TRSKafka

type TRSKafka struct {
	Client           *TRSKafkaClient
	ConsumerShutdown chan int
	RcvTopicNames    []string
	Mux              sync.Mutex
	Logger           *logrus.Logger
}

func (*TRSKafka) Init

func (trsKafka *TRSKafka) Init(ctx context.Context,
	initialReceiveTopics []string,
	consumerGroup string,
	brokerSpec string,
	tasksChan chan *sarama.ConsumerMessage, logger *logrus.Logger) (err error)

func (*TRSKafka) SetTopics

func (trsKafka *TRSKafka) SetTopics(topics []string) (err error)

func (*TRSKafka) Shutdown

func (trsKafka *TRSKafka) Shutdown()

func (*TRSKafka) Write

func (trsKafka *TRSKafka) Write(topic string, payload []byte)

type TRSKafkaClient

type TRSKafkaClient struct {
	Config        *sarama.Config
	Producer      *sarama.AsyncProducer
	ConsumerGroup *sarama.ConsumerGroup
	Consumer      *TRSKafkaConsumer
	Logger        *logrus.Logger
}

type TRSKafkaConsumer

type TRSKafkaConsumer struct {
	Errors    chan error
	Responses chan *sarama.ConsumerMessage
	Logger    *logrus.Logger
}

func (*TRSKafkaConsumer) Cleanup

func (*TRSKafkaConsumer) ConsumeClaim

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

func (*TRSKafkaConsumer) Setup

Jump to

Keyboard shortcuts

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