Interface IReceiveObserver
- Namespace
- MassTransit
- Assembly
- MassTransit.Abstractions.dll
An observer that can monitor a receive endpoint to track message consumption at the endpoint level.
public interface IReceiveObserver
Methods
ConsumeFault<T>(ConsumeContext<T>, TimeSpan, string, Exception)
Called when a message being consumed produced a fault
Task ConsumeFault<T>(ConsumeContext<T> context, TimeSpan duration, string consumerType, Exception exception) where T : class
Parameters
context
ConsumeContext<T>The message consume context
duration
TimeSpanThe consumer duration
consumerType
stringThe consumer type
exception
ExceptionThe exception from the consumer
Returns
Type Parameters
T
The message type
PostConsume<T>(ConsumeContext<T>, TimeSpan, string)
Called when a message has been consumed by a consumer
Task PostConsume<T>(ConsumeContext<T> context, TimeSpan duration, string consumerType) where T : class
Parameters
context
ConsumeContext<T>The message consume context
duration
TimeSpanThe consumer duration
consumerType
stringThe consumer type
Returns
Type Parameters
T
The message type
PostReceive(ReceiveContext)
Called when the message has been received and acknowledged on the transport
Task PostReceive(ReceiveContext context)
Parameters
context
ReceiveContextThe receive context of the message
Returns
PreReceive(ReceiveContext)
Called when a message has been delivered by the transport is about to be received by the endpoint
Task PreReceive(ReceiveContext context)
Parameters
context
ReceiveContextThe receive context of the message
Returns
ReceiveFault(ReceiveContext, Exception)
Called when the transport receive faults
Task ReceiveFault(ReceiveContext context, Exception exception)
Parameters
context
ReceiveContextThe receive context of the message
exception
ExceptionThe exception that was thrown