Skip to main content
Table of Contents

Class CommandEnvelope

Namespace
Stratara.Contracts.Messages
Assembly
Stratara.Contracts.dll

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

Id Guid

Stable envelope id (also used as the outbox row id).

CommandJson string

JSON serialization of the command's runtime instance.

CommandTypeName string

Version-independent type name used by the worker-side dispatcher to resolve the concrete command type.

SessionContextJson string

JSON serialization of the originating SessionContext for handler-side replay.

Signature string

Optional opaque signature produced by IBusEnvelopeSigner when bus integrity is enabled. Defaults to null for backwards compatibility with hosts that have not opted in.

Heavy bool

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.

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

string

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

string

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

bool

Id

Stable envelope id (also used as the outbox row id).

[JsonPropertyName("Id")]
public Guid Id { get; init; }

Property Value

Guid

SessionContextJson

JSON serialization of the originating SessionContext for handler-side replay.

[JsonPropertyName("SessionContextJson")]
public string SessionContextJson { get; init; }

Property Value

string

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; }

Property Value

string