Table of Contents

Class EnvelopeCloudEventBridge

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

Default implementation of IEnvelopeCloudEventBridge that composes the ICloudEventEnvelopeConverter with registered CloudEvent encoder adapters to translate Dispatch envelopes into transport-specific representations.

public sealed class EnvelopeCloudEventBridge : IEnvelopeCloudEventBridge
Inheritance
EnvelopeCloudEventBridge
Implements
Inherited Members
Extension Methods

Remarks

Encoders are resolved through pre-closed ICloudEventEncoderAdapter instances keyed by transport-message Type. This keeps the bridge trimming/AOT-safe: there is no MakeGenericType(params Type[]) and no late-bound dynamic dispatch — each generic encoder is closed once, at its DI registration site, via AddCloudEventEncoder.

Constructors

EnvelopeCloudEventBridge(ICloudEventEnvelopeConverter, IEnumerable<ICloudEventEncoderAdapter>)

Initializes a new instance of the EnvelopeCloudEventBridge class.

public EnvelopeCloudEventBridge(ICloudEventEnvelopeConverter converter, IEnumerable<ICloudEventEncoderAdapter> adapters)

Parameters

converter ICloudEventEnvelopeConverter

The envelope converter that produces CloudEvent instances.

adapters IEnumerable<ICloudEventEncoderAdapter>

The registered transport encoder adapters, keyed internally by transport-message type.

Methods

ToTransportAsync<TTransportMessage>(MessageEnvelope, CloudEventMode, CancellationToken)

Converts a MessageEnvelope into a transport message using the specified CloudEvent mode.

public Task<TTransportMessage> ToTransportAsync<TTransportMessage>(MessageEnvelope envelope, CloudEventMode mode, CancellationToken cancellationToken)

Parameters

envelope MessageEnvelope

The Dispatch message envelope to convert.

mode CloudEventMode

The CloudEvent mode to use during serialization.

cancellationToken CancellationToken

Cancellation token for the async operation.

Returns

Task<TTransportMessage>

The provider-specific transport message representation.

Type Parameters

TTransportMessage

The resulting transport message type.