Excalibur.Dispatch.Serialization.Protobuf
3.0.0-alpha.51
dotnet add package Excalibur.Dispatch.Serialization.Protobuf --version 3.0.0-alpha.51
NuGet\Install-Package Excalibur.Dispatch.Serialization.Protobuf -Version 3.0.0-alpha.51
<PackageReference Include="Excalibur.Dispatch.Serialization.Protobuf" Version="3.0.0-alpha.51" />
<PackageVersion Include="Excalibur.Dispatch.Serialization.Protobuf" Version="3.0.0-alpha.51" />
<PackageReference Include="Excalibur.Dispatch.Serialization.Protobuf" />
paket add Excalibur.Dispatch.Serialization.Protobuf --version 3.0.0-alpha.51
#r "nuget: Excalibur.Dispatch.Serialization.Protobuf, 3.0.0-alpha.51"
#:package Excalibur.Dispatch.Serialization.Protobuf@3.0.0-alpha.51
#addin nuget:?package=Excalibur.Dispatch.Serialization.Protobuf&version=3.0.0-alpha.51&prerelease
#tool nuget:?package=Excalibur.Dispatch.Serialization.Protobuf&version=3.0.0-alpha.51&prerelease
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
.protoschema definitions
Requirements Alignment
This package satisfies the following framework requirements:
- R0.14: Serializer segregation (opt-in package, NOT in Excalibur.Dispatch)
- R0.5: Transitive bloat guard (pay-for-play; only referenced when explicitly needed)
- R9.44: Internal wire uses MemoryPack (Core unchanged; Protobuf is opt-in only)
- R9.46: Opt-in binary alternatives (this package provides Protobuf as opt-in)
- R9.47: AOT/trim safety (source-generated Protobuf types are trim-safe)
Installation
dotnet add package Excalibur.Dispatch.Serialization.Protobuf
Usage
Basic Registration
using Excalibur.Dispatch.Serialization.Protobuf;
// In your service configuration (Program.cs or Startup.cs):
services.AddDispatch()
.AddProtobufSerialization(); // Opt-in to Protobuf support
Configure Protobuf Options
services.AddProtobufSerialization(options =>
{
// Wire format: Binary (default) or JSON
options.WireFormat = ProtobufWireFormat.Binary;
// Ignore missing fields during deserialization (default: true)
options.IgnoreMissingFields = true;
// Preserve unknown fields (default: false)
options.PreserveUnknownFields = false;
});
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
}
Serialization Example
using Excalibur.Dispatch.Abstractions.Serialization;
public class UserEventHandler
{
private readonly IMessageSerializer _serializer;
public UserEventHandler(IMessageSerializer serializer)
{
_serializer = serializer;
}
public async Task HandleAsync(UserCreatedEvent evt, CancellationToken ct)
{
// Serialize to binary Protobuf
byte[] data = _serializer.Serialize(evt);
// Deserialize from binary
var deserialized = _serializer.Deserialize<UserCreatedEvent>(data);
}
}
Package Dependencies
- Google.Protobuf - Protocol Buffers runtime
- Excalibur.Dispatch.Abstractions - Core contracts only (no Excalibur.Dispatch dependency)
- MemoryPack - Used internally per R9.44 (envelope/headers remain MemoryPack)
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
Binary (Default - Recommended)
options.WireFormat = ProtobufWireFormat.Binary;
- Compact binary format
- Fastest serialization/deserialization
- Best for internal/transport use
JSON
options.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 (
.protofiles) - You need schema evolution with backward/forward compatibility
Do NOT use Protobuf when:
- Internal Excalibur.Dispatch messaging (use MemoryPack - the default)
- Public HTTP/REST APIs (use System.Text.Json per R9.45)
- No Protobuf schema requirements exist
Architecture Notes
Per Excalibur framework requirements:
- Excalibur.Dispatch MUST NOT reference this package (R0.14 compliance)
- This package is pay-for-play (R0.5: no transitive bloat)
- MemoryPack remains the internal wire format (R9.44)
- System.Text.Json is used for public edges (R9.45)
- This package is opt-in only (R9.46)
Performance Characteristics
- Serialization: ~100-500 ns/op (binary), ~1-5 μs/op (JSON)
- Allocations: Minimal (reuses buffers where possible)
- Throughput: ~1-5 million msg/sec (binary), ~200k-1M msg/sec (JSON)
Benchmark results available in: management/perf/perf-baselines.json
Schema Evolution
Protobuf supports schema evolution via:
- Field numbers: Never reuse field numbers
- Reserved fields: Mark removed fields as
reserved - Optional fields: Use
optionalfor 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:
- GitHub: https://github.com/TrigintaFaces/Excalibur
- Documentation: (link to docs when published)
| Product | Versions 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. |
-
net10.0
- CloudNative.CloudEvents (>= 2.8.0)
- CloudNative.CloudEvents.SystemTextJson (>= 2.8.0)
- Cronos (>= 0.11.1)
- Excalibur.Dispatch (>= 3.0.0-alpha.51)
- Excalibur.Dispatch.Abstractions (>= 3.0.0-alpha.51)
- Google.Protobuf (>= 3.32.1)
- Medo.Uuid7 (>= 1.4.0)
- MemoryPack (>= 1.21.4)
- Microsoft.ApplicationInsights (>= 2.23.0)
- Microsoft.AspNetCore.Authorization (>= 9.0.9)
- Microsoft.Extensions.Configuration (>= 10.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Http (>= 10.0.0)
- Microsoft.Extensions.Logging (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.ObjectPool (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.0)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.0)
- System.Threading.RateLimiting (>= 10.0.0)
-
net8.0
- CloudNative.CloudEvents (>= 2.8.0)
- CloudNative.CloudEvents.SystemTextJson (>= 2.8.0)
- Cronos (>= 0.11.1)
- Excalibur.Dispatch (>= 3.0.0-alpha.51)
- Excalibur.Dispatch.Abstractions (>= 3.0.0-alpha.51)
- Google.Protobuf (>= 3.32.1)
- Medo.Uuid7 (>= 1.4.0)
- MemoryPack (>= 1.21.4)
- Microsoft.ApplicationInsights (>= 2.23.0)
- Microsoft.AspNetCore.Authorization (>= 9.0.9)
- Microsoft.Extensions.Configuration (>= 10.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Http (>= 10.0.0)
- Microsoft.Extensions.Logging (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.ObjectPool (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.0)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.0)
- System.Diagnostics.DiagnosticSource (>= 10.0.0)
- System.IO.Pipelines (>= 10.0.0)
- System.Threading.Channels (>= 10.0.0)
- System.Threading.RateLimiting (>= 10.0.0)
-
net9.0
- CloudNative.CloudEvents (>= 2.8.0)
- CloudNative.CloudEvents.SystemTextJson (>= 2.8.0)
- Cronos (>= 0.11.1)
- Excalibur.Dispatch (>= 3.0.0-alpha.51)
- Excalibur.Dispatch.Abstractions (>= 3.0.0-alpha.51)
- Google.Protobuf (>= 3.32.1)
- Medo.Uuid7 (>= 1.4.0)
- MemoryPack (>= 1.21.4)
- Microsoft.ApplicationInsights (>= 2.23.0)
- Microsoft.AspNetCore.Authorization (>= 9.0.9)
- Microsoft.Extensions.Configuration (>= 10.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Http (>= 10.0.0)
- Microsoft.Extensions.Logging (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.ObjectPool (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.0)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.0)
- System.Diagnostics.DiagnosticSource (>= 10.0.0)
- System.Threading.Channels (>= 10.0.0)
- System.Threading.RateLimiting (>= 10.0.0)
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.51 | 30 | 3/19/2026 |
| 3.0.0-alpha.48 | 30 | 3/18/2026 |
| 3.0.0-alpha.45 | 30 | 3/17/2026 |
| 3.0.0-alpha.44 | 39 | 3/16/2026 |
| 3.0.0-alpha.43 | 37 | 3/16/2026 |
| 3.0.0-alpha.42 | 34 | 3/16/2026 |
| 3.0.0-alpha.41 | 43 | 3/16/2026 |
| 3.0.0-alpha.33 | 41 | 3/15/2026 |
| 3.0.0-alpha.31 | 35 | 3/15/2026 |
| 3.0.0-alpha.26 | 39 | 3/5/2026 |
| 3.0.0-alpha.19 | 45 | 2/26/2026 |