Documentation ¶
Index ¶
- func Init(tAllowDebug bool, tServerAddress []string)
- func NewAsyncProducer(tServerAddressList []string) (sarama.AsyncProducer, error)
- func NewConsumer(tServerAddressList []string) (sarama.Client, error)
- func NewConsumerChildren()
- func NewProducer(isAsync bool) (*sarama.Config, error)
- func NewSyncProducer(tServerAddressList []string) (sarama.SyncProducer, error)
- func SendMessage(serverProducer sarama.SyncProducer, topic string, dataByte []byte) (partition int32, offset int64, err error)
- func SetDebug(tAllowDebug bool)
- func SetDebugServerAddress(tDebugServerAddress []string)
- func SetServerAddress(tServerAddress []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAsyncProducer ¶
func NewAsyncProducer(tServerAddressList []string) (sarama.AsyncProducer, error)
注册新的异步生产者关系 注意,defer关闭
func NewConsumer ¶
订阅消息 可以作为参考,或一般的服务消费者处理方案
func NewConsumerChildren ¶
func NewConsumerChildren()
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)
推送消息
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.