Class OutboundMessageTransport
Represents the delivery status of a message to a specific transport.
public sealed class OutboundMessageTransport
- Inheritance
-
OutboundMessageTransport
- Inherited Members
- Extension Methods
Remarks
This class tracks the delivery state of a single outbound message to a single transport. When a message needs to be published to multiple transports, each transport has its own OutboundMessageTransport record to track success/failure independently.
Constructors
OutboundMessageTransport()
Initializes a new instance of the OutboundMessageTransport class.
public OutboundMessageTransport()
OutboundMessageTransport(string, string)
Initializes a new instance of the OutboundMessageTransport class.
public OutboundMessageTransport(string messageId, string transportName)
Parameters
messageIdstringThe ID of the parent outbound message.
transportNamestringThe name of the target transport.
Properties
AttemptedAt
Gets or sets the timestamp when delivery was attempted.
public DateTimeOffset? AttemptedAt { get; set; }
Property Value
CreatedAt
Gets or sets the timestamp when this record was created.
public DateTimeOffset CreatedAt { get; set; }
Property Value
Destination
Gets or sets the transport-specific destination (queue, topic, exchange).
public string? Destination { get; set; }
Property Value
Id
Gets or sets the unique identifier for this transport record.
public string Id { get; set; }
Property Value
LastError
Gets or sets the last error message if delivery failed.
public string? LastError { get; set; }
Property Value
MessageId
Gets or sets the ID of the parent outbound message.
public string MessageId { get; set; }
Property Value
RetryCount
Gets or sets the number of delivery attempts.
public int RetryCount { get; set; }
Property Value
SentAt
Gets or sets the timestamp when delivery was successful.
public DateTimeOffset? SentAt { get; set; }
Property Value
Status
Gets or sets the current delivery status for this transport.
public TransportDeliveryStatus Status { get; set; }
Property Value
TransportMetadata
Gets or sets transport-specific metadata as JSON.
public string? TransportMetadata { get; set; }
Property Value
TransportName
Gets or sets the name of the target transport.
public string TransportName { get; set; }
Property Value
Methods
IsEligibleForRetry(int, int)
Determines if this transport delivery is eligible for retry.
public bool IsEligibleForRetry(int maxRetries = 3, int retryDelayMinutes = 5)
Parameters
Returns
- bool
True if eligible for retry.
MarkFailed(string)
Marks this transport delivery as failed.
public void MarkFailed(string error)
Parameters
errorstringThe error description.
MarkSending()
Marks this transport delivery as in progress.
public void MarkSending()
MarkSent()
Marks this transport delivery as successful.
public void MarkSent()
MarkSkipped(string?)
Marks this transport delivery as skipped (e.g., due to routing rules).
public void MarkSkipped(string? reason = null)
Parameters
reasonstringThe reason for skipping.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.