Interface ITransactionalOutboxPayloadTransformPreparer
Lets a selected decorator transform the owning provider's serialized bytes before immutable transactional preparation.
public interface ITransactionalOutboxPayloadTransformPreparer
- Extension Methods
Remarks
The owning provider freezes its actual runtime-message envelope and stable borrowed payload before calling the transform exactly once. It copies the returned bytes before completing final wire encoding. Callback faults, cancellation or a null result accept no write. The callback completes before any transaction begins. Payload-bearing outer decorators must not expose this raw facet to bypass their own mediation.
Methods
PrepareEnqueueWithPayloadTransformAsync(IDispatchMessage, IMessageContext, Func<ReadOnlyMemory<byte>, string?, CancellationToken, ValueTask<byte[]>>, CancellationToken)
Prepares a runtime message after applying one transform to its owning codec's serialized payload.
[RequiresUnreferencedCode("The owning runtime-message codec may discover arbitrary consumer payload metadata. Use explicit encoded envelopes for the metadata-safe route.")]
[RequiresDynamicCode("The owning runtime-message codec may require runtime code generation. Use explicit encoded envelopes for the metadata-safe route.")]
ValueTask<IPreparedTransactionalOutboxWrite> PrepareEnqueueWithPayloadTransformAsync(IDispatchMessage message, IMessageContext context, Func<ReadOnlyMemory<byte>, string?, CancellationToken, ValueTask<byte[]>> transformPayload, CancellationToken cancellationToken)
Parameters
messageIDispatchMessageThe runtime message.
contextIMessageContextThe context frozen by the owning provider.
transformPayloadFunc<ReadOnlyMemory<byte>, string, CancellationToken, ValueTask<byte[]>>The transform over stable borrowed payload bytes and frozen tenant provenance.
cancellationTokenCancellationTokenThe operation cancellation token.
Returns
- ValueTask<IPreparedTransactionalOutboxWrite>
A fully encoded immutable write, without persistence.
PrepareMessageWithPayloadTransformAsync(OutboundMessage, Func<ReadOnlyMemory<byte>, string?, CancellationToken, ValueTask<byte[]>>, CancellationToken)
Prepares an encoded envelope after transforming its payload, freezing provider metadata before the first callback await.
ValueTask<IPreparedTransactionalOutboxWrite> PrepareMessageWithPayloadTransformAsync(OutboundMessage message, Func<ReadOnlyMemory<byte>, string?, CancellationToken, ValueTask<byte[]>> transformPayload, CancellationToken cancellationToken)
Parameters
messageOutboundMessageThe caller-owned encoded envelope.
transformPayloadFunc<ReadOnlyMemory<byte>, string, CancellationToken, ValueTask<byte[]>>The transform over stable borrowed payload bytes and frozen tenant provenance.
cancellationTokenCancellationTokenThe operation cancellation token.
Returns
- ValueTask<IPreparedTransactionalOutboxWrite>
An immutable write whose metadata and routing were encoded before the transform could suspend.
Remarks
The owning provider encodes headers and transport metadata before invoking this callback. A decorator must not await encryption and then ask a later preparation call to inspect mutable header objects.