Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumerDeal ¶
type ConsumerDeal interface { //数据处理的实现 DealMessage(data []byte) error //消费组增加消费者的消息通知 Setup(topicAndPartitions map[string][]int32, memberId string, generationId int32) //消费组中消费者退出的消息通知 Cleanup(topicAndPartitions map[string][]int32, memberId string, generationId int32) }
使用者必须实现的接口
type ConsumerEvent ¶
type ConsumerEvent interface { //启动轮询消费数据 Start() error //关闭消费者,必须调用 Close() }
func NewConsumer ¶
func NewConsumer(param ConsumerParam) (ConsumerEvent, error)
type ConsumerParam ¶
type ConsumerParam struct { Address []string GroupId string Topic string DealHanle ConsumerDeal KafkaVer string }
type ProducerEvent ¶
type ProducerEvent interface { //发送消息接口 SendMessage(data []byte, key string) error //关闭生产者 Close() }
func NewAsyncProducer ¶
func NewAsyncProducer(param ProducerParam) (ProducerEvent, error)
Click to show internal directories.
Click to hide internal directories.