示例#1
0
        void InitializeHeaders()
        {
            var parsedHeaders = string.IsNullOrEmpty(originalHeaders)
                ? new Dictionary <string, string>()
                : DictionarySerializer.DeSerialize(originalHeaders);

            LegacyCallbacks.SubstituteReplyToWithCallbackQueueIfExists(parsedHeaders);

            Headers = parsedHeaders;
        }
 public static MessageRow From(Dictionary<string, string> headers, ReadOnlyMemory<byte> body, TimeSpan toBeReceived)
 {
     return new MessageRow
     {
         id = Guid.NewGuid(),
         timeToBeReceived = toBeReceived == TimeSpan.MaxValue ? null : (int?)toBeReceived.TotalMilliseconds,
         headers = DictionarySerializer.Serialize(headers),
         bodyBytes = body.ToArray()
     };
 }
示例#3
0
 public static MessageRow From(Dictionary <string, string> headers, byte[] body, TimeSpan toBeReceived)
 {
     return(new MessageRow
     {
         id = Guid.NewGuid(),
         correlationId = TryGetHeaderValue(headers, Headers.CorrelationId, s => s),
         replyToAddress = TryGetHeaderValue(headers, Headers.ReplyToAddress, s => s),
         timeToBeReceived = toBeReceived == TimeSpan.MaxValue ? null : (int?)toBeReceived.TotalMilliseconds,
         headers = DictionarySerializer.Serialize(headers),
         bodyBytes = body
     });
 }
        public static StoreDelayedMessageCommand From(Dictionary <string, string> headers, ReadOnlyMemory <byte> body, TimeSpan dueAfter, string destination)
        {
            Guard.AgainstNull(nameof(destination), destination);

            var row = new StoreDelayedMessageCommand();

            headers["NServiceBus.SqlServer.ForwardDestination"] = destination;
            row.headers   = DictionarySerializer.Serialize(headers);
            row.bodyBytes = body.ToArray();
            row.dueAfter  = dueAfter;
            return(row);
        }
        void InitializeHeaders()
        {
            var parsedHeaders = string.IsNullOrEmpty(originalHeaders)
                ? new Dictionary <string, string>()
                : DictionarySerializer.DeSerialize(originalHeaders);

            if (!string.IsNullOrEmpty(replyToAddress))
            {
                parsedHeaders[NServiceBus.Headers.ReplyToAddress] = replyToAddress;
            }

            LegacyCallbacks.SubstituteReplyToWithCallbackQueueIfExists(parsedHeaders);

            Headers = parsedHeaders;
        }