Documentation ¶
Index ¶
- type CustomConsumerGroupHandler
- func (h *CustomConsumerGroupHandler) Cleanup(session sarama.ConsumerGroupSession) error
- func (h *CustomConsumerGroupHandler) Close()
- func (h *CustomConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
- func (h *CustomConsumerGroupHandler) Msg() <-chan *sarama.ConsumerMessage
- func (h *CustomConsumerGroupHandler) Setup(session sarama.ConsumerGroupSession) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomConsumerGroupHandler ¶
type CustomConsumerGroupHandler struct {
// contains filtered or unexported fields
}
CustomConsumerGroupHandler 自定义消费句柄
func NewCustomConsumerGroupHandler ¶
func NewCustomConsumerGroupHandler(cfg *conf.KafkaConfig) (*CustomConsumerGroupHandler, error)
NewCustomConsumerGroupHandler 新建消费者.
func (*CustomConsumerGroupHandler) Cleanup ¶
func (h *CustomConsumerGroupHandler) Cleanup(session sarama.ConsumerGroupSession) error
Cleanup sarama.ConsumerGroupHandler接口定义实现. Cleanup() hook is called to allow the user to perform any final tasks before a rebalance once all the ConsumeClaim() loops have exited.
func (*CustomConsumerGroupHandler) Close ¶
func (h *CustomConsumerGroupHandler) Close()
Close 关闭并释放所有资源 (并发安全).
func (*CustomConsumerGroupHandler) ConsumeClaim ¶
func (h *CustomConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
ConsumeClaim sarama.ConsumerGroupHandler接口定义实现. ConsumeClaim() hook is called for each of the assigned claims.
func (*CustomConsumerGroupHandler) Msg ¶
func (h *CustomConsumerGroupHandler) Msg() <-chan *sarama.ConsumerMessage
Msg 返回消费通道.
func (*CustomConsumerGroupHandler) Setup ¶
func (h *CustomConsumerGroupHandler) Setup(session sarama.ConsumerGroupSession) error
Setup sarama.ConsumerGroupHandler接口定义实现. Setup() hook is called to notify the user of the claims and allow any necessary preparation or alteration of state.
Click to show internal directories.
Click to hide internal directories.