kconsumer

package
v2.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandleMessage

type HandleMessage func(ctx context.Context, msg *kafka.Message) error

HandleMessage is the user-provided function called for each consumed message. It receives the raw *kafka.Message so the caller has access to key, headers, and partition/offset metadata.

type PartitionConsumer

type PartitionConsumer struct {
	Topic      string
	Brokers    []string
	GroupID    string
	Properties []string
}

PartitionConsumer subscribes to a topic and runs a dedicated goroutine per assigned partition. Offset storage is explicit: only messages that were successfully handled are stored for auto-commit.

If you return an error from your handler, you get two retries before the consumer will quit and shutdown with an error.

func (*PartitionConsumer) Consume

func (c *PartitionConsumer) Consume(ctx context.Context, handle HandleMessage) error

Jump to

Keyboard shortcuts

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