Skip to content

Commit

Permalink
Hardening FailureAck over long messages, more info about outgoing mes…
Browse files Browse the repository at this point in the history
…sages
  • Loading branch information
jeremydmiller committed Aug 23, 2024
1 parent aaa9f21 commit f9d9ac8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ public async Task SendBatchAsync(ISenderCallback callback, OutgoingMessageBatch
await callback.MarkProcessingFailureAsync(batch, e);
}
}
}
}
2 changes: 1 addition & 1 deletion src/Wolverine/Runtime/MessageContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public async ValueTask SendFailureAcknowledgementAsync(string failureDescription
var acknowledgement = new FailureAcknowledgement
{
RequestId = Envelope.Id,
Message = failureDescription
Message = failureDescription.Elid(200)
};

var envelope = Runtime.RoutingFor(typeof(FailureAcknowledgement))
Expand Down
4 changes: 3 additions & 1 deletion src/Wolverine/Transports/Sending/SendingAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ Task ISenderCallback.MarkProcessingFailureAsync(OutgoingMessageBatch outgoing)

public Task MarkProcessingFailureAsync(OutgoingMessageBatch outgoing, Exception? exception)
{
var messageCounts = outgoing.Messages.GroupBy(x => x.MessageType).Select(x => $"{x.Key}:{x.Count()}").Join(", ");

_logger.LogError(exception,
"Failure trying to send a message batch to {Destination}", outgoing.Destination);
"Failure trying to send a message batch to {Destination} with messages {Counts}", outgoing.Destination, messageCounts);
_logger.OutgoingBatchFailed(outgoing, exception);
return markFailedAsync(outgoing);
}
Expand Down

0 comments on commit f9d9ac8

Please sign in to comment.