Table of Contents

Interface IAsyncSerializer<T>

Namespace
Solace.Serdes
Assembly
Solace.Serdes.dll

Asynchronous interface to convert POCO objects into serialized payload bytes. This interface supports modern .NET concurrency models and is designed for use with third-party serialization APIs that provide async operations.

public interface IAsyncSerializer<in T>

Type Parameters

T

Generic type argument for the input object on SerializeAsync(string, T, IDictionary<string, object>, CancellationToken)

Extension Methods

Methods

Configure(IDictionary<string, object>)

Configures this IAsyncSerializer<T> with the specified properties.

void Configure(IDictionary<string, object> properties)

Parameters

properties IDictionary<string, object>

The configuration properties

SerializeAsync(string, T, IDictionary<string, object>, CancellationToken)

Asynchronously serializes the given object into a byte array payload for the specified destination and optional headers.

Task<byte[]> SerializeAsync(string destinationName, T obj, IDictionary<string, object> headers = null, CancellationToken token = default)

Parameters

destinationName string

The topic or queue name to route the object.

obj T

Business object to serialize.

headers IDictionary<string, object>

Defines additional headers that are not included in the returned bytes. This parameter can be used as an in/out parameter and may be modified during serialization. May be null.

token CancellationToken

The cancellation token that can be used to cancel the asynchronous operation.

Returns

Task<byte[]>

A task that represents the asynchronous operation. The task result contains a byte array from the serialized object that will be added as carrier payload.