Class RabbitConsumerErrorHandler
- Namespace
- adas_core.Infrastructure.Utils
- Assembly
- adas-core.Infrastructure.dll
Handles errors that occur during RabbitMQ message consumption and publishes them using the configured publisher service.
public class RabbitConsumerErrorHandler
- Inheritance
-
RabbitConsumerErrorHandler
- Inherited Members
- Extension Methods
Constructors
RabbitConsumerErrorHandler(IPublisherService)
Handles errors that occur during RabbitMQ message consumption and publishes them using the configured publisher service.
public RabbitConsumerErrorHandler(IPublisherService publisherService)
Parameters
publisherServiceIPublisherService
Methods
HandleAsync<T>(Message<T>, MessageReceivedInfo, Func<Task>)
Processes a received message by invoking the next handler in the pipeline, and on failure logs the error, serializes the message body to a string, and delegates to the retry handler using the message properties, received info, and the captured exception.
public Task HandleAsync<T>(Message<T> message, MessageReceivedInfo receivedInfo, Func<Task> next)
Parameters
messageMessage<T>The deserialized message whose body is inspected or re-serialized for retry handling.
receivedInfoMessageReceivedInfoInformation about the message receipt, passed to the retry handler.
nextFunc<Task>The asynchronous delegate representing the next step in the processing pipeline.
Returns
Type Parameters
T