Table of Contents

Interface Request<TSaga, TRequest, TResponse>

Namespace
MassTransit
Assembly
MassTransit.Abstractions.dll

A request is a state-machine based request configuration that includes the events and states related to the execution of a request.

public interface Request<in TSaga, TRequest, TResponse> where TSaga : class, SagaStateMachineInstance where TRequest : class where TResponse : class

Type Parameters

TSaga
TRequest

The request type

TResponse

The response type

Properties

Completed

The event that is raised when the request completes and the response is received

Event<TResponse> Completed { get; set; }

Property Value

Event<TResponse>

Faulted

The event raised when the request faults

Event<Fault<TRequest>> Faulted { get; set; }

Property Value

Event<Fault<TRequest>>

Name

The name of the request

string Name { get; }

Property Value

string

Pending

The state that is transitioned to once the request is pending

State Pending { get; set; }

Property Value

State

Settings

The settings that are used for the request, including the timeout

RequestSettings Settings { get; }

Property Value

RequestSettings

TimeoutExpired

The event raised when the request times out with no response received

Event<RequestTimeoutExpired<TRequest>> TimeoutExpired { get; set; }

Property Value

Event<RequestTimeoutExpired<TRequest>>

Methods

GenerateRequestId(TSaga)

Generate a requestId, using either the CorrelationId of the saga, or a NewId

Guid GenerateRequestId(TSaga instance)

Parameters

instance TSaga

Returns

Guid

GetRequestId(TSaga)

Gets the requestId on the instance using the configured property

Guid? GetRequestId(TSaga instance)

Parameters

instance TSaga

Returns

Guid?

SetRequestId(TSaga, Guid?)

Sets the requestId on the instance using the configured property

void SetRequestId(TSaga instance, Guid? requestId)

Parameters

instance TSaga
requestId Guid?

SetSendContextHeaders(SendContext<TRequest>)

Set the headers on the outgoing request SendContext<T>

void SetSendContextHeaders(SendContext<TRequest> context)

Parameters

context SendContext<TRequest>