kafka

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultIntervalSecs = 60

Variables

View Source
var DefaultKafkaVersion = sarama.V0_10_0_0

Functions

This section is empty.

Types

type Monitor

type Monitor struct {
	closer.Closer
	// contains filtered or unexported fields
}

func NewKafkaMonitor

func NewKafkaMonitor(
	clusterID proto.ClusterID,
	moduleName string,
	brokerHosts []string,
	topic string,
	pids []int32,
	intervalSecs int64) (*Monitor, error,
)

func (*Monitor) SetConsumeOffset

func (monitor *Monitor) SetConsumeOffset(consumerOff int64, pid int32)

type MsgProducer

type MsgProducer interface {
	SendMessage(topic string, msg []byte) (err error)
	SendMessages(topic string, msgs [][]byte) (err error)
}

type Producer

type Producer struct {
	sarama.SyncProducer
}

func NewProducer

func NewProducer(cfg *ProducerCfg) (*Producer, error)

func (*Producer) SendMessage

func (p *Producer) SendMessage(topic string, msg []byte) (err error)

func (*Producer) SendMessages

func (p *Producer) SendMessages(topic string, msgs [][]byte) (err error)

type ProducerCfg

type ProducerCfg struct {
	BrokerList []string `json:"broker_list"`
	Topic      string   `json:"topic"`
	TimeoutMs  int64    `json:"timeout_ms"`
}

Jump to

Keyboard shortcuts

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