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
envelopeMessageEnvelopeThe message envelope to convert.
cancellationTokenCancellationTokenCancellation 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
cloudEventCloudEventThe CloudEvent to convert.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<MessageEnvelope>
A MessageEnvelope with all properties restored from CloudEvent attributes.