Table of Contents

Interface ReceiveContext

Namespace
MassTransit
Assembly
MassTransit.Abstractions.dll

The receive context is sent from the transport when a message is ready to be processed from the transport.

public interface ReceiveContext : PipeContext
Inherited Members
Extension Methods

Properties

Body

The message body

MessageBody Body { get; }

Property Value

MessageBody

ContentType

The content type of the message, as determined by the available headers

ContentType ContentType { get; }

Property Value

ContentType

ElapsedTime

TimeSpan ElapsedTime { get; }

Property Value

TimeSpan

InputAddress

The address on which the message was received

Uri InputAddress { get; }

Property Value

Uri

IsDelivered

Returns true if the message was successfully consumed by at least one consumer

bool IsDelivered { get; }

Property Value

bool

IsFaulted

Returns true if a fault occurred during the message delivery

bool IsFaulted { get; }

Property Value

bool

PublishEndpointProvider

The publish endpoint provider from the transport

IPublishEndpointProvider PublishEndpointProvider { get; }

Property Value

IPublishEndpointProvider

PublishFaults

If true (the default), faults should be published when no ResponseAddress or FaultAddress are present.

bool PublishFaults { get; }

Property Value

bool

ReceiveCompleted

The task that is completed once all pending tasks are completed

Task ReceiveCompleted { get; }

Property Value

Task

Redelivered

If True, the message is being redelivered by the transport

bool Redelivered { get; }

Property Value

bool

SendEndpointProvider

The send endpoint provider from the transport

ISendEndpointProvider SendEndpointProvider { get; }

Property Value

ISendEndpointProvider

TransportHeaders

Headers specific to the transport

Headers TransportHeaders { get; }

Property Value

Headers

Methods

AddReceiveTask(Task)

Adds a pending Task to the completion of the message receiver

void AddReceiveTask(Task task)

Parameters

task Task

NotifyConsumed<T>(ConsumeContext<T>, TimeSpan, string)

Notify that a message has been consumed from the received context

Task NotifyConsumed<T>(ConsumeContext<T> context, TimeSpan duration, string consumerType) where T : class

Parameters

context ConsumeContext<T>

The consume context of the message

duration TimeSpan

The time spent by the consumer

consumerType string

The consumer type

Returns

Task

Type Parameters

T

NotifyFaulted(Exception)

Notify that a message receive faulted outside of the message consumer

Task NotifyFaulted(Exception exception)

Parameters

exception Exception

The exception that occurred

Returns

Task

NotifyFaulted<T>(ConsumeContext<T>, TimeSpan, string, Exception)

Notify that a message consumer faulted

Task NotifyFaulted<T>(ConsumeContext<T> context, TimeSpan duration, string consumerType, Exception exception) where T : class

Parameters

context ConsumeContext<T>

The consume context of the message

duration TimeSpan

The time spent by the consumer

consumerType string

The message consumer type that faulted

exception Exception

The exception that occurred

Returns

Task

Type Parameters

T