redpanda

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

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

Consumer represents a Kafka consumer.

func NewConsumer

func NewConsumer(kafkaBrokers, subscribeRegexes []string, groupId, instanceId string, initialOffset int64) (*Consumer, error)

NewConsumer initializes and returns a new Consumer instance.

func (*Consumer) GetAllLastMessages added in v1.12.0

func (c *Consumer) GetAllLastMessages() (map[string]*shared.KafkaMessage, error)

func (*Consumer) GetAllTopics added in v1.12.0

func (c *Consumer) GetAllTopics() ([]string, error)

GetAllTopics returns all topics available in the Kafka cluster.

func (*Consumer) GetLastMessageFromTopic added in v1.12.0

func (c *Consumer) GetLastMessageFromTopic(topic string) (*shared.KafkaMessage, error)

GetLastMessageFromTopic returns the latest message from a topic.

func (*Consumer) GetMessage

func (c *Consumer) GetMessage() *shared.KafkaMessage

GetMessage returns the next message from the consumer.

func (*Consumer) GetMessages

func (c *Consumer) GetMessages() <-chan *shared.KafkaMessage

GetMessages returns the channel of messages from the consumer.

func (*Consumer) GetStats

func (c *Consumer) GetStats() (uint64, uint64)

GetStats returns consumed message counts.

func (*Consumer) GetTopics

func (c *Consumer) GetTopics() []string

GetTopics returns the topics that the consumer is subscribed to.

func (*Consumer) IsReady added in v1.8.10

func (c *Consumer) IsReady() bool

IsReady returns whether the consumer is ready to consume messages.

func (*Consumer) MarkMessage

func (c *Consumer) MarkMessage(message *shared.KafkaMessage)

MarkMessage marks a message as processed.

func (*Consumer) MarkMessages

func (c *Consumer) MarkMessages(messages []*shared.KafkaMessage)

MarkMessages marks a slice of messages as processed.

func (*Consumer) UnsafeGetClient added in v1.12.0

func (c *Consumer) UnsafeGetClient() *sarama.Client

UnsafeGetClient should only be used as a last resort.

type ConsumerGroupHandler added in v1.8.9

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

ConsumerGroupHandler represents a Sarama consumer group consumer

func (*ConsumerGroupHandler) Cleanup added in v1.8.9

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

func (*ConsumerGroupHandler) ConsumeClaim added in v1.8.9

ConsumeClaim must start a consumer loop of ConsumerGroupClaim's Messages(). Once the Messages() channel is closed, the Handler must finish its processing loop and exit.

func (*ConsumerGroupHandler) Setup added in v1.8.9

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

Jump to

Keyboard shortcuts

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