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 SyncProducer ¶
func SyncProducer()
同步生产
初始化NewConfig配置 sarama.NewConfig 创建生产者sarama.NewSyncProducer 创建消息sarama.ProducerMessage 发送消息client.SendMessage,同步获取返回信息
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.