kafkaconsumer

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Consumes flows from a Kafka instance and passes them to the following segments. This segment is based on the kafkaconnector library: https://github.com/bwNetFlow/kafkaconnector

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler represents a Sarama consumer group consumer

func (*Handler) Cleanup

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

func (*Handler) ConsumeClaim

func (h *Handler) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

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

func (*Handler) Setup

func (h *Handler) Setup(session sarama.ConsumerGroupSession) error

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

type KafkaConsumer

type KafkaConsumer struct {
	segments.BaseSegment
	Server  string        // required
	Topic   string        // required
	Group   string        // required
	User    string        // required if auth is true
	Pass    string        // required if auth is true
	Tls     bool          // optional, default is true
	Auth    bool          // optional, default is true
	StartAt string        // optional, one of "oldest" or "newest", default is "newest"
	Timeout time.Duration // optional, default is 15s, any parsable duration
	// contains filtered or unexported fields
}

FIXME: clean up those todos

func (KafkaConsumer) New

func (segment KafkaConsumer) New(config map[string]string) segments.Segment

func (*KafkaConsumer) Run

func (segment *KafkaConsumer) Run(wg *sync.WaitGroup)

Jump to

Keyboard shortcuts

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