Documentation
¶
Index ¶
- Variables
- func ConsumerStop()
- func InitConsumer(cfg *config.RocketMq)
- func InitProducer(cfg *config.RocketMq)
- func ProducerStop()
- func RegisterConsumer(c Consumer)
- func Send(ctx context.Context, topic string, body []byte, opts ...MessageOpts) error
- func StartConsumer(ctx context.Context, endpoint, accessKey, secretKey string, consumer Consumer)
- type AckFn
- type Consumer
- type MessageOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrReceipt = errors.New("send message receipt empty")
Functions ¶
Types ¶
type Consumer ¶
type Consumer interface { // GroupName 组名称 GroupName() string // Number 消费组消费者数量,消费者数量大于1时会异步执行,否则时同步执行 Number() int // Subscribe 订阅的主题和tag, key是要订阅的topic,value是要订阅的tag,所有是* Subscribe() map[string]string // Run 消费者消费消息逻辑,异步执行时处理成功需要主动调用AckFn函数,否则AckFun是nil Run(*rmq.MessageView, AckFn) error }
Consumer 消费者接口
Click to show internal directories.
Click to hide internal directories.