规划消费者

This commit is contained in:
2022-07-08 16:53:42 +08:00
parent 85f9e62590
commit d049110155
3 changed files with 121 additions and 5 deletions

View File

@@ -19,6 +19,16 @@ type ProduceData struct {
Data map[string]interface{} `json:"data"` // 传入的业务数据
}
// ZRangeData zRange读取的数据
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 14:24 2022/7/8
type ZRangeData struct {
Score int64 // 数据分值
Data *ProduceData // 实际业务数据
}
// Queue 队列数据
//
// Author : go_developer@163.com<白茶清欢>
@@ -39,3 +49,15 @@ type Queue struct {
func (q *Queue) Err() error {
return q.err
}
// ConsumerConfig 消费者配置
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 14:12 2022/7/8
type ConsumerConfig struct {
QueueName string // 队列名称
SonQueueCnt int // 二级队列数量
SonQueName string // 二级队列名称
HashKey string // hash消息写到哪个二级队列的key, 若不配置或者key不存在, 使用 ProduceData.MsgID
}