databus

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2019 License: MIT Imports: 5 Imported by: 0

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)

type ProducerParam

type ProducerParam struct {
	Address  []string
	Topic    string
	IsAck    bool
	KafkaVer string
}

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL