saramax

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchHandler

type BatchHandler[T interface{}] struct {
	// contains filtered or unexported fields
}

func NewBatchHandler

func NewBatchHandler[T interface{}](l logger.Logger,
	fn func(msgs []*sarama.ConsumerMessage, t []T) error) *BatchHandler[T]

func (*BatchHandler[T]) Cleanup

func (h *BatchHandler[T]) Cleanup(session sarama.ConsumerGroupSession) error

func (*BatchHandler[T]) ConsumeClaim

func (h *BatchHandler[T]) ConsumeClaim(session sarama.ConsumerGroupSession,
	claim sarama.ConsumerGroupClaim) error

func (*BatchHandler[T]) Setup

func (h *BatchHandler[T]) Setup(session sarama.ConsumerGroupSession) error

type Consumer

type Consumer interface {
	Start() error
}

type Handler

type Handler[T interface{}] struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler[T interface{}](l logger.Logger,
	fn func(msg *sarama.ConsumerMessage, t T) error) *Handler[T]

func (*Handler[T]) Cleanup

func (h *Handler[T]) Cleanup(session sarama.ConsumerGroupSession) error

func (*Handler[T]) ConsumeClaim

func (h *Handler[T]) ConsumeClaim(session sarama.ConsumerGroupSession,
	claim sarama.ConsumerGroupClaim) error

ConsumeClaim 可以考虑在这个封装里面提供统一的重试机制

func (*Handler[T]) Setup

func (h *Handler[T]) Setup(session sarama.ConsumerGroupSession) error

Jump to

Keyboard shortcuts

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