Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct { *Base Func func(b []byte) error //接收json的处理方式 Client sarama.ConsumerGroup // contains filtered or unexported fields }
func NewConsumer ¶
NewConsumer 创建消费者 创建消费者后可以调整config相关参数 addrs地址数组["172.0.0.1:9092","172.0.0.1:9093"] version kafka版本号 f 处理方法
type GroupHandler ¶
GroupHandler represents a Sarama consumer group consumer 在分区变更时会触发GroupHandler退出重启
func (*GroupHandler) Cleanup ¶
func (c *GroupHandler) Cleanup(ss sarama.ConsumerGroupSession) error
Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited
func (*GroupHandler) ConsumeClaim ¶
func (c *GroupHandler) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) (topErr error)
func (*GroupHandler) Setup ¶
func (c *GroupHandler) Setup(ss sarama.ConsumerGroupSession) error
Setup is run at the beginning of a new session, before ConsumeClaim
type Producer ¶
type Producer struct { *Base // contains filtered or unexported fields }
func NewProducer ¶
NewProducer 创建生产者后需要调用init初始化,初始化之前可以调整config相关参数
Click to show internal directories.
Click to hide internal directories.