=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -11,6 +11,7 @@ namespace adas_core.Infrastructure.Utils;
|
||||
/// <summary>
|
||||
/// Handles errors that occur during RabbitMQ message consumption and publishes them using the configured publisher service.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=5b1d5b6 -->
|
||||
public class RabbitConsumerErrorHandler(IPublisherService publisherService)
|
||||
{
|
||||
private const int MaxRetries = 2;
|
||||
@@ -24,6 +25,7 @@ public class RabbitConsumerErrorHandler(IPublisherService publisherService)
|
||||
/// <param name="message">The deserialized message whose body is inspected or re-serialized for retry handling.</param>
|
||||
/// <param name="receivedInfo">Information about the message receipt, passed to the retry handler.</param>
|
||||
/// <param name="next">The asynchronous delegate representing the next step in the processing pipeline.</param>
|
||||
/// <!-- aidoc:v1 sig=f916bf0 body=5a18c25 -->
|
||||
public async Task HandleAsync<T>(
|
||||
Message<T> message,
|
||||
MessageReceivedInfo receivedInfo,
|
||||
@@ -127,6 +129,7 @@ public class RabbitConsumerErrorHandler(IPublisherService publisherService)
|
||||
/// </summary>
|
||||
/// <param name="properties">The message properties whose headers are inspected for the "retries" entry.</param>
|
||||
/// <returns>The number of retries parsed from the "retries" header, or 0 if the header is absent or not a byte array.</returns>
|
||||
/// <!-- aidoc:v1 sig=d7573fc body=b1a585f -->
|
||||
private int GetRetries(MessageProperties properties)
|
||||
{
|
||||
if (properties.Headers != null &&
|
||||
@@ -148,6 +151,7 @@ public class RabbitConsumerErrorHandler(IPublisherService publisherService)
|
||||
/// <param name="exception">The exception that was raised, whose message is included in the error payload.</param>
|
||||
/// <param name="headers">The headers to associate with the resulting error message.</param>
|
||||
/// <returns>A <see cref="Message{Error}"/> containing the constructed error and the propagated message properties.</returns>
|
||||
/// <!-- aidoc:v1 sig=250e4be body=a4fe29e -->
|
||||
private static Message<Error> CreateErrorMessage(
|
||||
MessageReceivedInfo receivedInfo,
|
||||
MessageProperties originalProperties,
|
||||
|
||||
Reference in New Issue
Block a user