Table of Contents

Interface ISendObserver

Namespace
MassTransit
Assembly
MassTransit.Abstractions.dll

Observes messages as they are sent to transports. These should not be used to intercept or filter messages, in that case a filter should be created and registered on the transport.

public interface ISendObserver

Methods

PostSend<T>(SendContext<T>)

Called after the message is sent to the transport (and confirmed by the transport if supported)

Task PostSend<T>(SendContext<T> context) where T : class

Parameters

context SendContext<T>

The message send context

Returns

Task

Type Parameters

T

The message type

PreSend<T>(SendContext<T>)

Called before the message is sent to the transport

Task PreSend<T>(SendContext<T> context) where T : class

Parameters

context SendContext<T>

The message send context

Returns

Task

Type Parameters

T

The message type

SendFault<T>(SendContext<T>, Exception)

Called when the message fails to send to the transport, including the exception that was thrown

Task SendFault<T>(SendContext<T> context, Exception exception) where T : class

Parameters

context SendContext<T>

The message send context

exception Exception

The exception from the transport

Returns

Task

Type Parameters

T

The message type