simple

package
v0.73.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package simple provides a simple consumer implementation without consumer groups.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDurationOffset added in v0.49.0

func WithDurationOffset(since time.Duration, timeExtractor TimeExtractor) kafka.OptionFunc

WithDurationOffset allows creating a consumer from a given duration. It accepts a function indicating how to extract the time from a Kafka message.

func WithNotificationOnceReachingLatestOffset added in v0.57.0

func WithNotificationOnceReachingLatestOffset(ch chan<- struct{}) kafka.OptionFunc

WithNotificationOnceReachingLatestOffset closes the input channel once all the partition consumers have reached the latest offset.

func WithTimestampOffset added in v0.67.0

func WithTimestampOffset(since time.Duration) kafka.OptionFunc

WithTimestampOffset allows creating a consumer from a given duration.

Types

type Factory

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

Factory definition of a consumer factory.

func New

func New(name, topic string, brokers []string, saramaCfg *sarama.Config, oo ...kafka.OptionFunc) (*Factory, error)

New constructor.

func (*Factory) Create

func (f *Factory) Create() (async.Consumer, error)

Create a new asynchronous consumer.

type TimeExtractor added in v0.49.0

type TimeExtractor func(*sarama.ConsumerMessage) (time.Time, error)

TimeExtractor defines a function extracting a time from a Kafka message.

Jump to

Keyboard shortcuts

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