コード例 #1
0
        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;
        }
コード例 #2
0
        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)
 {
 }
コード例 #4
0
 public void Defer(TransportMessage message, SendOptions sendOptions)
 {
    Sender.Send(message, sendOptions);
 }