From 05c929c24ca4503dca8a9e6a6e477cfa66f7ba0f Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 18 Nov 2022 16:12:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8C=81=E4=B9=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rabbitmq.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rabbitmq.go b/rabbitmq.go index 302b483..474e440 100644 --- a/rabbitmq.go +++ b/rabbitmq.go @@ -106,9 +106,11 @@ func (r *rabbitmq) Publish(exchangeName, msg string, delay ...int64) error { false, //强制为 false, //立即 amqp.Publishing{ - ContentType: "text/plain", - Body: []byte(msg), - Headers: header, + ContentType: "text/plain", + Body: []byte(msg), + DeliveryMode: amqp.Persistent, + Timestamp: time.Now(), + Headers: header, }) }