public SqsTransportMessage(TransportMessage transportMessage, SendOptions sendOptions)
        {
            Headers = transportMessage.Headers;

            Body = transportMessage.Body != null ? Convert.ToBase64String(transportMessage.Body) : "empty message";

            TimeToBeReceived = transportMessage.TimeToBeReceived;

			ReplyToAddress = sendOptions.ReplyToAddress;
        }
        void Defer(TimeSpan defer, TransportMessage message)
        {
            var retryMessageAt = DateTime.UtcNow + defer;

            TransportMessageHeaderHelper.SetHeader(message, Headers.Retries,
                (TransportMessageHeaderHelper.GetNumberOfRetries(message) + 1).ToString(CultureInfo.InvariantCulture));

            var addressOfFaultingEndpoint = TransportMessageHeaderHelper.GetAddressOfFaultingEndpoint(message);

            if (!TransportMessageHeaderHelper.HeaderExists(message, SecondLevelRetriesHeaders.RetriesTimestamp))
            {
                TransportMessageHeaderHelper.SetHeader(message, SecondLevelRetriesHeaders.RetriesTimestamp,
                    DateTimeExtensions.ToWireFormattedString(DateTime.UtcNow));
            }

            logger.DebugFormat("Defer message and send it to {0}", addressOfFaultingEndpoint);

            var sendOptions = new SendOptions(addressOfFaultingEndpoint)
            {
                DeliverAt = retryMessageAt
            };

            MessageDeferrer.Defer(message, sendOptions);
        }
Пример #3
0
 public void Send(TransportMessage message, SendOptions sendOptions)
 {
 }
 public void Defer(TransportMessage message, SendOptions sendOptions)
 {
    Sender.Send(message, sendOptions);
 }