Excalibur.Dispatch.Serialization.Protobuf 3.0.0-alpha.118

This is a prerelease version of Excalibur.Dispatch.Serialization.Protobuf.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Excalibur.Dispatch.Serialization.Protobuf --version 3.0.0-alpha.118
                    
NuGet\Install-Package Excalibur.Dispatch.Serialization.Protobuf -Version 3.0.0-alpha.118
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Excalibur.Dispatch.Serialization.Protobuf" Version="3.0.0-alpha.118" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Excalibur.Dispatch.Serialization.Protobuf" Version="3.0.0-alpha.118" />
                    
Directory.Packages.props
<PackageReference Include="Excalibur.Dispatch.Serialization.Protobuf" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Excalibur.Dispatch.Serialization.Protobuf --version 3.0.0-alpha.118
                    
#r "nuget: Excalibur.Dispatch.Serialization.Protobuf, 3.0.0-alpha.118"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Excalibur.Dispatch.Serialization.Protobuf@3.0.0-alpha.118
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Excalibur.Dispatch.Serialization.Protobuf&version=3.0.0-alpha.118&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Excalibur.Dispatch.Serialization.Protobuf&version=3.0.0-alpha.118&prerelease
                    
Install as a Cake Tool

Excalibur.Dispatch.Serialization.Protobuf

Opt-in Protocol Buffers serialization support for the Excalibur framework.

Purpose

Provides Protocol Buffers (Protobuf) serialization for:

  • Google Cloud Platform (GCP) interoperability
  • AWS service integration requiring Protobuf
  • High-performance binary protocols
  • External systems using .proto schema definitions

Installation

dotnet add package Excalibur.Dispatch.Serialization.Protobuf

Usage

One call does everything -- DI registration, serializer registry entry, and setting Protobuf as the current serializer:

services.AddProtobufSerializer();

Configure Protobuf Options

services.AddProtobufSerializer(opts =>
{
    // Wire format: Binary (default) or JSON
    opts.WireFormat = ProtobufWireFormat.Binary;
});

Message Definition

Your message types must implement Google.Protobuf.IMessage and have source-generated parsers:

using Google.Protobuf;

// Example: Generated from .proto file
public partial class UserCreatedEvent : IMessage<UserCreatedEvent>
{
    // Source-generated Protobuf code
}

Package Dependencies

  • Google.Protobuf - Protocol Buffers runtime
  • Excalibur.Dispatch.Abstractions - Core contracts only (no Excalibur.Dispatch dependency)

AOT Compatibility

Native AOT compatible with source-generated Protobuf types.

Ensure your .proto files are compiled with protoc to generate C# code, and the generated types will be trim-safe.

Wire Formats

opts.WireFormat = ProtobufWireFormat.Binary;
  • Compact binary format
  • Fastest serialization/deserialization
  • Best for internal/transport use

JSON

opts.WireFormat = ProtobufWireFormat.Json;
  • Human-readable JSON representation
  • Useful for debugging or external API boundaries
  • Slower than binary format

When to Use This Package

Use Protobuf serialization when:

  • Integrating with GCP services (Cloud Pub/Sub, Cloud Functions, etc.)
  • AWS services require Protobuf (EventBridge, Kinesis with Protobuf schema)
  • External systems expose Protobuf schemas (.proto files)
  • You need schema evolution with backward/forward compatibility

Do NOT use Protobuf when:

  • Internal Excalibur.Dispatch messaging (use MemoryPack or JSON)
  • Public HTTP/REST APIs (use System.Text.Json)
  • No Protobuf schema requirements exist

Architecture Notes

Per Excalibur framework requirements:

  1. Excalibur.Dispatch MUST NOT reference this package (R0.14 compliance)
  2. This package is pay-for-play (R0.5: no transitive bloat)
  3. System.Text.Json is the default serializer (ADR-295)
  4. This package is opt-in only (R9.46)

Performance Characteristics

  • Serialization: ~100-500 ns/op (binary), ~1-5 us/op (JSON)
  • Allocations: Minimal (reuses buffers where possible)
  • Throughput: ~1-5 million msg/sec (binary), ~200k-1M msg/sec (JSON)

Schema Evolution

Protobuf supports schema evolution via:

  • Field numbers: Never reuse field numbers
  • Reserved fields: Mark removed fields as reserved
  • Optional fields: Use optional for nullable fields
  • Unknown fields: Preserved if PreserveUnknownFields = true

Example .proto:

syntax = "proto3";

message UserCreatedEvent {
  string user_id = 1;
  string email = 2;
  reserved 3; // Removed field
  // New field with number 4
  string full_name = 4;
}

License

This package is licensed under the same licenses as the Excalibur framework:

  • Excalibur License 1.0
  • GNU Affero General Public License v3.0 or later (AGPL-3.0)
  • Server Side Public License v1.0 (SSPL-1.0)
  • Apache License 2.0

See LICENSE files in project root for details.

Support

For issues, questions, or contributions, visit:

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-alpha.143 0 4/14/2026
3.0.0-alpha.138 17 4/13/2026
3.0.0-alpha.131 31 4/10/2026
3.0.0-alpha.129 30 4/10/2026
3.0.0-alpha.125 31 4/10/2026
3.0.0-alpha.120 41 4/8/2026
3.0.0-alpha.118 31 4/8/2026
3.0.0-alpha.85 44 4/3/2026
3.0.0-alpha.84 50 3/31/2026
3.0.0-alpha.83 41 3/31/2026
3.0.0-alpha.82 46 3/31/2026
3.0.0-alpha.80 47 3/30/2026
3.0.0-alpha.79 43 3/29/2026
3.0.0-alpha.76 43 3/29/2026
3.0.0-alpha.75 44 3/27/2026
3.0.0-alpha.74 43 3/27/2026
3.0.0-alpha.70 39 3/26/2026
3.0.0-alpha.68 39 3/25/2026
3.0.0-alpha.66 40 3/25/2026
3.0.0-alpha.64 39 3/25/2026
Loading failed