sarama_client

package
v0.0.0-...-0216257 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsyncProducer

func AsyncProducer()

* 异步生产

初始化NewConfig配置 sarama.NewConfig
创建生产者sarama.NewAsyncProducer
创建消息sarama.ProducerMessage
发送消息producer.Input() <- msg
接收消息回调:select:{suc := <-producer.Successes()}{fail := <-producer.Errors()}

func Consumer

func Consumer()

func SyncProducer

func SyncProducer()

同步生产

初始化NewConfig配置 sarama.NewConfig
创建生产者sarama.NewSyncProducer
创建消息sarama.ProducerMessage
发送消息client.SendMessage,同步获取返回信息

Types

This section is empty.

Jump to

Keyboard shortcuts

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