Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BindConsumer ¶
type BindConsumer struct {
// contains filtered or unexported fields
}
BindConsumer BIND 方式实现的消费者
func (*BindConsumer) Topics ¶
func (c *BindConsumer) Topics() []string
type Consumer ¶
type Consumer interface {
Topics() []string // 声明消费的主题列表
Consume(ctx context.Context, msg *Message)
}
Consumer 消息消费者
type Message ¶
type Message struct {
Topic string
Body []byte // 也叫 Value
MessageId string // 也叫 Key
Properties map[string]string // 附加的属性对
}
Message 简单消息
func (*Message) AddProperty ¶
AddProperty 给 Message 添加一个属性对
func (*Message) WithJsonBody ¶
WithJsonBody 设置 Message 的消息体 NOTE:到底应不应该抛可愁死我了!
func (*Message) WithMessageId ¶
WithMessageId 设置 Message 的消息 ID
Click to show internal directories.
Click to hide internal directories.