Introduction

What is Solace Generic SERDES for .NET?

Solace Generic SERDES for .NET is a lightweight, high-performance serialization and deserialization library designed specifically for Solace messaging applications. It provides a set of well-defined interfaces and implementations that enable efficient conversion between .NET objects and byte arrays for message transmission.

Key Concepts

Serialization and Deserialization

Serialization is the process of converting a .NET object into a byte array suitable for transmission over Solace messaging infrastructure.

Deserialization is the reverse process - converting received byte arrays back into .NET objects.

Robust Header support on Serialization and Deserialization

SERDES headers allow for a separation of metadata for serialization from payload encoding to avoid custom encoding of standard formats.

Serialization can populate header map of key value pairs to avoid additional serdes metadata encoding in the payload.

Deserialization can customize deserialization behaviour based on provided header map of key value pairs.

Interface-Based Design

The library provides four core interfaces that form the foundation of the serialization framework:

  • ISerializer<T> - Synchronous serialization from objects to byte arrays
  • IDeserializer<T> - Synchronous deserialization from byte arrays to objects
  • IAsyncSerializer<T> - Asynchronous serialization with cancellation support
  • IAsyncDeserializer<T> - Asynchronous deserialization with cancellation support

This interface-based approach allows you to implement custom serializers for any data format (UTF8 String, JSON, Avro, etc.) while maintaining compatibility with the Solace messaging ecosystem.

Why Use This Library?

Performance Optimizations

  • Zero-copy deserialization: Uses ReadOnlySpan<byte> to avoid unnecessary memory allocations
  • Efficient encoding: Built-in utilities for optimized character encoding operations
  • Minimal overhead: Lightweight interfaces with no heavyweight dependencies

Flexibility

  • Pluggable serializers: Implement custom serialization for any format
  • Configuration support: All serializers support runtime configuration via dictionaries
  • Sync and async: Choose the programming model that fits your application

Broad Compatibility

  • Target framework: .NET Standard 2.0 for maximum compatibility across .NET implementations
  • Strong-named: Suitable for use in enterprise environments requiring signed assemblies