CoreKafka

package
v5.1.42 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(tAllowDebug bool, tServerAddress []string)

初始化

func NewAsyncProducer

func NewAsyncProducer(tServerAddressList []string) (sarama.AsyncProducer, error)

注册新的异步生产者关系 注意,defer关闭

func NewConsumer

func NewConsumer(tServerAddressList []string) (sarama.Client, error)

订阅消息 可以作为参考,或一般的服务消费者处理方案

func NewConsumerChildren

func NewConsumerChildren()

func NewProducer

func NewProducer(isAsync bool) (*sarama.Config, error)

连接到服务

func NewSyncProducer

func NewSyncProducer(tServerAddressList []string) (sarama.SyncProducer, error)

注册新的同步生产者关系 注意,defer关闭

func SendMessage

func SendMessage(serverProducer sarama.SyncProducer, topic string, dataByte []byte) (partition int32, offset int64, err error)

推送消息

func SetDebug

func SetDebug(tAllowDebug bool)

设置debug

func SetDebugServerAddress

func SetDebugServerAddress(tDebugServerAddress []string)

设置debug地址序列

func SetServerAddress

func SetServerAddress(tServerAddress []string)

设置服务地址序列

Types

This section is empty.

Jump to

Keyboard shortcuts

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