Table of Contents

Interface ISerializationCallback

Namespace
AWS.Messaging.Serialization
Assembly
AWS.Messaging.dll

This interface exposes serialization callbacks that lets users inject their own metadata to incoming and outgoing messages. It contains no-op default implementations for all methods so that user implementations of this interface only need to add overrides for specific methods.

public interface ISerializationCallback

Methods

PostDeserializationAsync(MessageEnvelope)

This can be used to set additional metadata to the message envelope after it is deserialized and handed over to the subscriber for further processing.

ValueTask PostDeserializationAsync(MessageEnvelope messageEnvelope)

Parameters

messageEnvelope MessageEnvelope

This envelope adheres to the CloudEvents specification v1.0 and contains all the attributes that are marked as required by the spec. The CloudEvent spec can be found https://github.com/cloudevents/spec/blob/main/cloudevents/spec.mdhere.

Returns

ValueTask

PostSerializationAsync(string)

This can be used to encrypt or modify the serialized message envelope before publishing it to an endpoint.

ValueTask<string> PostSerializationAsync(string message)

Parameters

message string

The serialized message envelope

Returns

ValueTask<string>

PreDeserializationAsync(string)

This can be used to decrypt or modify the serialized message after it is retrieved by the message poller.

ValueTask<string> PreDeserializationAsync(string message)

Parameters

message string

The serialized message retrieved by the message poller

Returns

ValueTask<string>

PreSerializationAsync(MessageEnvelope)

This can be used to set additional metadata to the message envelope before it serialized and published to an endpoint.

ValueTask PreSerializationAsync(MessageEnvelope messageEnvelope)

Parameters

messageEnvelope MessageEnvelope

This envelope adheres to the CloudEvents specification v1.0 and contains all the attributes that are marked as required by the spec. The CloudEvent spec can be found https://github.com/cloudevents/spec/blob/main/cloudevents/spec.mdhere.

Returns

ValueTask