diff --git a/rabbitmq.go b/rabbitmq.go index c90b9e0..302b483 100644 --- a/rabbitmq.go +++ b/rabbitmq.go @@ -133,9 +133,11 @@ func (r *rabbitmq) PublishWithContext(ctx context.Context, exchangeName, key, ms false, //强制为 false, //立即 amqp.Publishing{ - ContentType: "text/plain", - Body: []byte(msg), - Headers: header, + ContentType: "text/plain", + DeliveryMode: amqp.Persistent, + Timestamp: time.Now(), + Body: []byte(msg), + Headers: header, }) }