trs_kafka

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 8 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 *kafka.Message, 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 {
	Producer *kafka.Producer
	Consumer *TRSKafkaConsumer
	Logger   *logrus.Logger
}

type TRSKafkaConsumer

type TRSKafkaConsumer struct {
	Errors    chan error
	Responses chan *kafka.Message
	Logger    *logrus.Logger
}

Jump to

Keyboard shortcuts

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