forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMqExtensions.cs
More file actions
25 lines (24 loc) · 923 Bytes
/
Copy pathMqExtensions.cs
File metadata and controls
25 lines (24 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System.Collections.Generic;
using System.Globalization;
using ServiceStack.Messaging;
using ServiceStack.Text;
namespace ServiceStack
{
public static class MqExtensions
{
public static Dictionary<string, string> ToHeaders(this IMessage message)
{
var map = new Dictionary<string, string>
{
{"CreatedDate",message.CreatedDate.ToString("D")},
{"Priority",message.Priority.ToString(CultureInfo.InvariantCulture)},
{"RetryAttempts",message.RetryAttempts.ToString(CultureInfo.InvariantCulture)},
{"ReplyId",message.ReplyId?.ToString()},
{"ReplyTo",message.ReplyTo},
{"Options",message.Options.ToString(CultureInfo.InvariantCulture)},
{"Error",message.Error.Dump()},
};
return map;
}
}
}