kafka

package
v0.0.0-...-e1367df Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMessageLastOffset

func GetMessageLastOffset(topic, groupId string, partition int32) (int64, error)

* 获取kafka消费组最大可用偏移量

func ReceiveMessage

func ReceiveMessage(topic, groupId string, batchSize int32, batchInterval time.Duration, callback ConsumerCallback) error

* 接收消费消息 * * param topic 主题 * param groupId 消费组名称 * param batchSize 批量消费数量 * param batchInterval 批量消费间隔时间 * param callback 获取消息回调函数

func SendMessage

func SendMessage(topic string, text []byte) error

* 发送生产消息 * * param topic 主题 * param text 发送消息内容

Types

type ConsumerCallback

type ConsumerCallback func([]*sarama.ConsumerMessage) bool

类型:获取消息回调函数

Jump to

Keyboard shortcuts

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