1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-30 22:33:49 +02:00

add rmq message properties (#2177)

Co-authored-by: dtitov <dtitov@might24.ru>
This commit is contained in:
Dmitry Titov
2021-06-08 16:34:47 +07:00
committed by GitHub
parent a1e9b88495
commit 52bb3845f6
2 changed files with 102 additions and 0 deletions

View File

@ -162,6 +162,47 @@ func (r *rbroker) Publish(topic string, msg *broker.Message, opts ...broker.Publ
if value, ok := options.Context.Value(priorityKey{}).(uint8); ok {
m.Priority = value
}
if value, ok := options.Context.Value(contentType{}).(string); ok {
m.ContentType = value
}
if value, ok := options.Context.Value(contentEncoding{}).(string); ok {
m.ContentEncoding = value
}
if value, ok := options.Context.Value(correlationID{}).(string); ok {
m.CorrelationId = value
}
if value, ok := options.Context.Value(replyTo{}).(string); ok {
m.ReplyTo = value
}
if value, ok := options.Context.Value(expiration{}).(string); ok {
m.Expiration = value
}
if value, ok := options.Context.Value(messageID{}).(string); ok {
m.MessageId = value
}
if value, ok := options.Context.Value(timestamp{}).(time.Time); ok {
m.Timestamp = value
}
if value, ok := options.Context.Value(typeMsg{}).(string); ok {
m.Type = value
}
if value, ok := options.Context.Value(userID{}).(string); ok {
m.UserId = value
}
if value, ok := options.Context.Value(appID{}).(string); ok {
m.AppId = value
}
}
for k, v := range msg.Header {