代码拉取完成,页面将自动刷新
package mq
type Topic struct {
Topic string
BrokerName string
QueueId int
}
type Expression struct {
Type string
Exp string
}
type Message struct {
MsgId string
QueueId int
Topic string
Tags string
Keys string
Body string
Property map[string]string
}
type Status int
const (
ConOk = Status(0)
ConFail = Status(1)
)
type Type int
const (
ConTypePush = Type(0)
ConTypePull = Type(1)
)
type Consumer interface {
Start() error
Stop()
//Subscribe 建议外面使用 go goroutine
Subscribe(topic Topic, exp Expression, call func(msg *Message) Status) error
}
func NewConsumer(con Type, cfg Config) Consumer {
switch con {
case ConTypePush:
return NewPushConsumer(cfg)
case ConTypePull:
return NewPullConsumer(cfg)
}
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。