consumer

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommittingProcessor

func NewCommittingProcessor(processor processor.SpanProcessor, marker offsetMarker) processor.SpanProcessor

NewCommittingProcessor returns a processor that commits message offsets to Kafka

Types

type Consumer

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

Consumer uses sarama to consume and handle messages from kafka

func New

func New(params Params) (*Consumer, error)

New is a constructor for a Consumer

func (*Consumer) Close

func (c *Consumer) Close() error

Close closes the Consumer and underlying sarama consumer

func (*Consumer) Start

func (c *Consumer) Start()

Start begins consuming messages in a go routine

type Message

type Message interface {
	Key() []byte
	Value() []byte
	Topic() string
	Partition() int32
	Offset() int64
}

Message contains the parts of a sarama ConsumerMessage that we care about.

type Params

type Params struct {
	ProcessorFactory      ProcessorFactory
	MetricsFactory        metrics.Factory
	Logger                *zap.Logger
	InternalConsumer      consumer.Consumer
	DeadlockCheckInterval time.Duration
}

Params are the parameters of a Consumer

type ProcessorFactory

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

ProcessorFactory is a factory for creating startedProcessors

func NewProcessorFactory

func NewProcessorFactory(params ProcessorFactoryParams) (*ProcessorFactory, error)

NewProcessorFactory constructs a new ProcessorFactory

type ProcessorFactoryParams

type ProcessorFactoryParams struct {
	Parallelism    int
	Topic          string
	BaseProcessor  processor.SpanProcessor
	SaramaConsumer consumer.Consumer
	Factory        metrics.Factory
	Logger         *zap.Logger
	RetryOptions   []decorator.RetryOption
}

ProcessorFactoryParams are the parameters of a ProcessorFactory

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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