mirror of
https://github.com/eventials/goevents.git
synced 2025-04-24 13:48:53 +08:00
fix msg timestamp when publish
This commit is contained in:
parent
978c81a1c1
commit
04bec7e32d
@ -194,9 +194,10 @@ func (c *consumer) doDispatch(msg amqplib.Delivery, h *handler, retryCount int32
|
||||
}
|
||||
|
||||
log := logger.WithFields(logrus.Fields{
|
||||
"action": h.action,
|
||||
"body": string(msg.Body),
|
||||
"message_id": msg.MessageId,
|
||||
"action": h.action,
|
||||
"body": string(msg.Body),
|
||||
"message_id": msg.MessageId,
|
||||
"published_at": msg.Timestamp.String(),
|
||||
})
|
||||
|
||||
if err == nil {
|
||||
|
@ -95,7 +95,7 @@ func (p *producer) Publish(action string, data []byte) {
|
||||
Timestamp: now,
|
||||
Body: data,
|
||||
Headers: amqp.Table{
|
||||
"x-epoch-milli": now.Unix() / int64(time.Millisecond),
|
||||
"x-epoch-milli": int64(now.UnixNano()/int64(time.Nanosecond)) / int64(time.Millisecond),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user