consumer

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

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
}

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