From 57be7f3f335f9360f5352622a73a3ca74283a367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Wed, 6 Jul 2022 19:00:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=95=B0=E6=8D=AE=E5=A2=9E?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E5=8A=A0=E6=B6=88=E6=81=AF=E7=9A=84=E6=9C=BA?= =?UTF-8?q?=E5=99=A8IP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- delay/define.go | 1 + delay/redis_produce.go | 1 + 2 files changed, 2 insertions(+) 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{