Table of Contents

Interface ICloudEventEnvelopeConverter

Namespace
Excalibur.Dispatch.CloudEvents
Assembly
Excalibur.Dispatch.dll

Converts between MessageEnvelope and CloudEvent while preserving DoD-required envelope properties.

public interface ICloudEventEnvelopeConverter
Extension Methods

Remarks

Ensures round-trip conversion with no attribute loss for: MessageId, CorrelationId, TenantId, UserId, TraceId, RetryCount, ScheduledTime, and Timestamp as specified by DoD requirements.

Methods

FromEnvelopeAsync(MessageEnvelope, CancellationToken)

Converts a MessageEnvelope to a CloudEvent while preserving all envelope properties.

Task<CloudEvent> FromEnvelopeAsync(MessageEnvelope envelope, CancellationToken cancellationToken)

Parameters

envelope MessageEnvelope

The message envelope to convert.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<CloudEvent>

A CloudEvent with all envelope properties preserved as extension attributes.

ToEnvelopeAsync(CloudEvent, CancellationToken)

Converts a CloudEvent back to a MessageEnvelope while restoring all envelope properties.

Task<MessageEnvelope> ToEnvelopeAsync(CloudEvent cloudEvent, CancellationToken cancellationToken)

Parameters

cloudEvent CloudEvent

The CloudEvent to convert.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<MessageEnvelope>

A MessageEnvelope with all properties restored from CloudEvent attributes.