protected override async Task DeadLetter(MessageReadResult receiveResult, SqlConnection connection, SqlTransaction transaction)
 {
     using (var errorConnection = await connectionFactory.OpenNewConnection(ErrorQueue.TransportAddress).ConfigureAwait(false))
     {
         await ErrorQueue.DeadLetter(receiveResult.PoisonMessage, errorConnection, null).ConfigureAwait(false);
     }
 }
예제 #2
0
        MessageReadResult TryParse()
        {
            try
            {
                var parsedHeaders = IsNullOrEmpty(headers)
                    ? new Dictionary <string, string>()
                    : DictionarySerializer.DeSerialize(headers);

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

                LegacyCallbacks.SubstituteReplyToWithCallbackQueueIfExists(parsedHeaders);
                return(MessageReadResult.Success(new Message(id.ToString(), parsedHeaders, bodyBytes, expired)));
            }
            catch (Exception ex)
            {
                Logger.Error("Error receiving message. Probable message metadata corruption. Moving to error queue.", ex);
                return(MessageReadResult.Poison(this));
            }
        }
예제 #3
0
 protected virtual Task DeadLetter(MessageReadResult receiveResult, SqlConnection connection, SqlTransaction transaction)
 {
     return(ErrorQueue.DeadLetter(receiveResult.PoisonMessage, connection, transaction));
 }