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
MessageEnvelopeThis 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
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
stringThe serialized message envelope
Returns
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
stringThe serialized message retrieved by the message poller
Returns
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
MessageEnvelopeThis 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.