Interface ICloudEventEncoder<TOutbound>
Maps a CloudEvent into a provider-specific outbound transport message.
public interface ICloudEventEncoder<TOutbound>
Type Parameters
TOutboundThe transport message type produced for send.
- Extension Methods
Remarks
Split from the former ICloudEventMapper<T>: every transport that
supports CloudEvents can encode, but not every transport's send type is meaningfully decodable -- four of
the original eight mappers are typed on send-only provider SDK types (SendMessageRequest,
PublishRequest, PutEventsRequestEntry, ServiceBusMessage) that never appear as an
inbound object. Decoding is a separate concern; see Excalibur.Dispatch.Transport.ICloudEventDecoder<TInbound>.
Properties
Options
Gets the options used to configure CloudEvent serialization.
CloudEventOptions Options { get; }
Property Value
- CloudEventOptions
The options used to configure CloudEvent serialization.
Methods
ToTransportMessageAsync(CloudEvent, CloudEventMode, CancellationToken)
Converts a CloudEvent instance into a provider-specific transport message.
Task<TOutbound> ToTransportMessageAsync(CloudEvent cloudEvent, CloudEventMode mode, CancellationToken cancellationToken)
Parameters
cloudEventCloudEventThe CloudEvent to convert.
modeCloudEventModeThe serialization mode to apply.
cancellationTokenCancellationTokenCancellation token for the async operation.
Returns
- Task<TOutbound>
The serialized transport message.