Class SendContextExtensions
- Namespace
- MassTransit
- Assembly
- MassTransit.Abstractions.dll
public static class SendContextExtensions
- Inheritance
-
SendContextExtensions
- Inherited Members
Methods
ApplyRedeliveryOptions(SendContext, ConsumeContext, RedeliveryOptions)
public static void ApplyRedeliveryOptions(this SendContext sendContext, ConsumeContext consumeContext, RedeliveryOptions options)
Parameters
sendContext
SendContextconsumeContext
ConsumeContextoptions
RedeliveryOptions
GetOriginalMessageId(ConsumeContext)
Returns the original MessageId from the message headers, or the MessageId if not present
public static Guid? GetOriginalMessageId(this ConsumeContext context)
Parameters
context
ConsumeContext
Returns
- Guid?
ReplaceMessageId(SendContext, ConsumeContext)
Generate a new MessageId, storing the original MessageId in the OriginalMessageId header (unless it already exists)
public static SendContext ReplaceMessageId(this SendContext sendContext, ConsumeContext consumeContext)
Parameters
sendContext
SendContextconsumeContext
ConsumeContext
Returns
SetExceptionHeaders(SendHeaders, ExceptionReceiveContext)
Set the host headers on the SendContext (for error, dead-letter, etc.)
public static void SetExceptionHeaders(this SendHeaders headers, ExceptionReceiveContext exceptionContext)
Parameters
headers
SendHeadersexceptionContext
ExceptionReceiveContext
SetExceptionHeaders<T>(ITransportSetHeaderAdapter<T>, IDictionary<string, T>, ExceptionReceiveContext)
Set the host headers on the SendContext (for error, dead-letter, etc.)
public static void SetExceptionHeaders<T>(this ITransportSetHeaderAdapter<T> adapter, IDictionary<string, T> headers, ExceptionReceiveContext exceptionContext)
Parameters
adapter
ITransportSetHeaderAdapter<T>headers
IDictionary<string, T>exceptionContext
ExceptionReceiveContext
Type Parameters
T
SetHostHeaders(SendHeaders)
Set the host headers on the SendContext (for error, dead-letter, etc.)
public static void SetHostHeaders(this SendHeaders headers)
Parameters
headers
SendHeaders
SetHostHeaders<T>(ITransportSetHeaderAdapter<T>, IDictionary<string, T>)
Set the host headers on the SendContext (for error, dead-letter, etc.)
public static void SetHostHeaders<T>(this ITransportSetHeaderAdapter<T> adapter, IDictionary<string, T> dictionary)
Parameters
adapter
ITransportSetHeaderAdapter<T>dictionary
IDictionary<string, T>
Type Parameters
T
StartNewConversation(SendContext)
Sets the ConversationId to a new value, starting a new conversation. If a message was being consumed, and the ConversationId was present, that value is stored in an MT-InitiatingConversationId header.
public static SendContext StartNewConversation(this SendContext context)
Parameters
context
SendContextThe send context
Returns
StartNewConversation(SendContext, Guid)
Sets the ConversationId to a new value, starting a new conversation. If a message was being consumed, and the ConversationId was present, that value is stored in an MT-InitiatingConversationId header.
public static SendContext StartNewConversation(this SendContext context, Guid conversationId)
Parameters
context
SendContextThe send context
conversationId
GuidThe new ConversationId
Returns
TransferConsumeContextHeaders(SendContext, ConsumeContext)
Transfer the header information from the ConsumeContext to the SendContext, including any non-MT headers.
public static void TransferConsumeContextHeaders(this SendContext sendContext, ConsumeContext consumeContext)
Parameters
sendContext
SendContextconsumeContext
ConsumeContext