Back to

Package consumer

Latest Go to latest

The latest major version is .

Published: Nov 7, 2019 | License: Apache-2.0 | Module:


func NewCommittingProcessor

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

NewCommittingProcessor returns a processor that commits message offsets to Kafka

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier