Class CommandEnvelope
Wire-level envelope for a command in transit through the outbox / message bus. Carries the serialized command payload plus the metadata needed to re-resolve its CLR type and propagate the session context.
[ExcludeFromCodeCoverage]
public sealed record CommandEnvelope : IEquatable<CommandEnvelope>
- Inheritance
-
CommandEnvelope
- Implements
- Inherited Members
- Extension Methods
Remarks
Property names are pinned via JsonPropertyNameAttribute so the wire format is independent of
any consumer-side JsonSerializerOptions.PropertyNamingPolicy.
Constructors
CommandEnvelope(Guid, string, string, string, string?, bool)
Wire-level envelope for a command in transit through the outbox / message bus. Carries the serialized command payload plus the metadata needed to re-resolve its CLR type and propagate the session context.
public CommandEnvelope(Guid Id, string CommandJson, string CommandTypeName, string SessionContextJson, string? Signature = null, bool Heavy = false)
Parameters
IdGuidStable envelope id (also used as the outbox row id).
CommandJsonstringJSON serialization of the command's runtime instance.
CommandTypeNamestringVersion-independent type name used by the worker-side dispatcher to resolve the concrete command type.
SessionContextJsonstringJSON serialization of the originating SessionContext for handler-side replay.
SignaturestringOptional opaque signature produced by
IBusEnvelopeSignerwhen bus integrity is enabled. Defaults tonullfor backwards compatibility with hosts that have not opted in.HeavyboolWhether the command declared itself long-running when it was enqueued. Recorded at enqueue time so republication from durable storage can route the envelope to the heavy lane without re-resolving the command's CLR type. Defaults to
false, which is how an envelope written before this field existed deserializes.
Remarks
Property names are pinned via JsonPropertyNameAttribute so the wire format is independent of
any consumer-side JsonSerializerOptions.PropertyNamingPolicy.
Properties
CommandJson
JSON serialization of the command's runtime instance.
[JsonPropertyName("CommandJson")]
public string CommandJson { get; init; }
Property Value
CommandTypeName
Version-independent type name used by the worker-side dispatcher to resolve the concrete command type.
[JsonPropertyName("CommandTypeName")]
public string CommandTypeName { get; init; }
Property Value
Heavy
Whether the command declared itself long-running when it was enqueued. Recorded at enqueue time so
republication from durable storage can route the envelope to the heavy lane without re-resolving the
command's CLR type. Defaults to false, which is how an envelope written before this field
existed deserializes.
[JsonPropertyName("Heavy")]
public bool Heavy { get; init; }
Property Value
Id
Stable envelope id (also used as the outbox row id).
[JsonPropertyName("Id")]
public Guid Id { get; init; }
Property Value
SessionContextJson
JSON serialization of the originating SessionContext for handler-side replay.
[JsonPropertyName("SessionContextJson")]
public string SessionContextJson { get; init; }
Property Value
Signature
Optional opaque signature produced by IBusEnvelopeSigner when bus integrity is enabled. Defaults to null for backwards compatibility with hosts that have not opted in.
[JsonPropertyName("Signature")]
public string? Signature { get; init; }