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); } }
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)); } }
protected virtual Task DeadLetter(MessageReadResult receiveResult, SqlConnection connection, SqlTransaction transaction) { return(ErrorQueue.DeadLetter(receiveResult.PoisonMessage, connection, transaction)); }