diff --git a/delay/define.go b/delay/define.go index 7a3acc5..4870186 100644 --- a/delay/define.go +++ b/delay/define.go @@ -15,6 +15,7 @@ package delay type ProduceData struct { MsgID string `json:"msg_id"` // 消息ID Timestamp int64 `json:"timestamp"` // 消息生成时间: ms + Host string `json:"host"` // 生产消息的机器IP Data map[string]interface{} `json:"data"` // 传入的业务数据 } diff --git a/delay/redis_produce.go b/delay/redis_produce.go index b2cdbf0..58a5bab 100644 --- a/delay/redis_produce.go +++ b/delay/redis_produce.go @@ -69,6 +69,7 @@ func (rp *redisProduce) buildAddMember(queueData *Queue) *redis.Z { byteData, _ := json.Marshal(&ProduceData{ MsgID: util.String.Md5(util.String.GenRandom("", 16)), Timestamp: time.Now().UnixNano() / 1e6, + Host: util.IP.GetHostIP(), Data: queueData.Data, }) return &redis.Z{