Excalibur.Dispatch.Serialization.MemoryPack
10.0.0-alpha.16
dotnet add package Excalibur.Dispatch.Serialization.MemoryPack --version 10.0.0-alpha.16
NuGet\Install-Package Excalibur.Dispatch.Serialization.MemoryPack -Version 10.0.0-alpha.16
<PackageReference Include="Excalibur.Dispatch.Serialization.MemoryPack" Version="10.0.0-alpha.16" />
<PackageVersion Include="Excalibur.Dispatch.Serialization.MemoryPack" Version="10.0.0-alpha.16" />
<PackageReference Include="Excalibur.Dispatch.Serialization.MemoryPack" />
paket add Excalibur.Dispatch.Serialization.MemoryPack --version 10.0.0-alpha.16
#r "nuget: Excalibur.Dispatch.Serialization.MemoryPack, 10.0.0-alpha.16"
#:package Excalibur.Dispatch.Serialization.MemoryPack@10.0.0-alpha.16
#addin nuget:?package=Excalibur.Dispatch.Serialization.MemoryPack&version=10.0.0-alpha.16&prerelease
#tool nuget:?package=Excalibur.Dispatch.Serialization.MemoryPack&version=10.0.0-alpha.16&prerelease
Excalibur.Dispatch.Serialization.MemoryPack
High-performance MemoryPack binary serialization for Excalibur framework.
Purpose
Provides opt-in high-performance binary serialization for:
- Workloads where matched measurements favor this binary format
- .NET-to-.NET communication
- Internal persistence (Outbox, Inbox, Event Store)
- Deployments whose concrete payload and API compatibility has been verified
Key Features
- Opt-In: JSON (System.Text.Json) is the default serializer. Install this package and register explicitly when its format suits your workload.
- Serializer ID 1: Magic byte
0x01in persisted payloads - Span-Based Input: ReadOnlySpan-based deserialization; output objects and envelope processing can allocate
- Source-generated formatters: Custom payload types normally need
[MemoryPackable]generation or a registered custom formatter. Supported built-in types need not all carry attributes. Internal envelope attributes do not cover arbitrary consumer payloads. - NativeAOT verification required: The framework serializer currently carries dynamic-code and trimming annotations. Generated formatters alone do not establish compatibility of every wrapper API or consumer type.
Usage
Registration
One call does everything -- DI registration, serializer registry entry, and setting MemoryPack as the current serializer:
services.AddMemoryPackSerializer();
That is all you need. JSON is the default serializer; calling AddMemoryPackSerializer() opts you into MemoryPack for high-performance binary serialization.
Performance Characteristics
The October 16 verification report records scoped first-pass results for the framework's envelope APIs, including 712–65,704 allocated bytes per accepted outbox-envelope deserialization operation. Two cases failed and three finite sibling results remain withheld. These measurements do not establish a general serializer ranking, zero-allocation guarantee, repeated latency comparison or NativeAOT performance. Measure the actual payload and API before selecting a serializer for a performance requirement.
Pluggable Serialization Integration
MemoryPack is assigned Serializer ID 1 in the pluggable serialization system.
The magic byte 0x01 prefixes all MemoryPack-serialized payloads.
Stored Payload: [0x01][MemoryPack binary data...]
^
Magic byte identifies serializer
When to Use MemoryPack
Best For:
- Internal .NET-to-.NET communication
- Payloads whose measured latency, allocations and size meet your requirements
- Event sourcing and Outbox persistence
- Concrete deployment paths verified with the selected payload types
Consider Alternatives When:
- Cross-language consumers (use MessagePack - ID: 3)
- Debugging/human-readable storage (use System.Text.Json - ID: 2, the default)
- Schema-based contracts (use Protobuf - ID: 4)
Migration
From JSON to MemoryPack
// One call switches new messages to MemoryPack.
// Keep the JSON serializer registered to read old JSON data via its magic byte.
services.AddMemoryPackSerializer();
From MemoryPack to Another Serializer
// Switch to a different serializer. Old MemoryPack data remains
// readable only while its serializer remains registered; the magic byte selects it.
services.AddMessagePackSerializer();
Package Dependencies
MemoryPack- Core MemoryPack serialization runtimeExcalibur.Dispatch.Abstractions- Core contracts
AOT Compatibility
The internal envelope types use [MemoryPackable] with partial declarations. Custom consumer payload types also need compatible generated or registered formatters when passed directly to MemoryPack. See MemoryPack's supported built-in types and external-type serialization.
The framework wrapper currently declares RequiresDynamicCode and RequiresUnreferencedCode. Verify the exact consumer payloads and APIs in a native executable with trimming and AOT warnings enabled before making a compatibility claim. The managed performance observations above are not NativeAOT certification.
See Also
License
This project is multi-licensed under:
See LICENSE for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.12.0)
- Excalibur.Dispatch (>= 10.0.0-alpha.16)
- Excalibur.Dispatch.Abstractions (>= 10.0.0-alpha.16)
- Medo.Uuid7 (>= 3.2.0)
- MemoryPack (>= 1.21.4)
- Microsoft.Extensions.Configuration (>= 10.0.10)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.10)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Http (>= 10.0.10)
- Microsoft.Extensions.Logging (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Microsoft.Extensions.ObjectPool (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.10)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.10)
- System.Threading.RateLimiting (>= 10.0.7)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Excalibur.Dispatch.Serialization.MemoryPack:
| Package | Downloads |
|---|---|
|
Excalibur.Data.MongoDB
MongoDB database provider implementation for Excalibur data access layer. PRE-RELEASE: the public API is not frozen and may change between pre-release builds. Not recommended for production use. Known issues: https://docs.excalibur-dispatch.dev/docs/known-issues |
|
|
Excalibur.EventSourcing.Postgres
Postgres implementations for Excalibur event sourcing, including event store, snapshot store, and outbox store. PRE-RELEASE: the public API is not frozen and may change between pre-release builds. Not recommended for production use. Known issues: https://docs.excalibur-dispatch.dev/docs/known-issues |
|
|
Excalibur.EventSourcing.SqlServer
SQL Server implementations for Excalibur event sourcing, including event store, snapshot store, and outbox store. PRE-RELEASE: the public API is not frozen and may change between pre-release builds. Not recommended for production use. Known issues: https://docs.excalibur-dispatch.dev/docs/known-issues |
|
|
Excalibur.Data.Postgres
Postgres database provider implementation for Excalibur data access layer. PRE-RELEASE: the public API is not frozen and may change between pre-release builds. Not recommended for production use. Known issues: https://docs.excalibur-dispatch.dev/docs/known-issues |
|
|
Excalibur.EventSourcing.Sqlite
SQLite implementations for Excalibur event sourcing. Lightweight event store and snapshot store for local development, testing, and embedded scenarios. Zero Docker dependency. PRE-RELEASE: the public API is not frozen and may change between pre-release builds. Not recommended for production use. Known issues: https://docs.excalibur-dispatch.dev/docs/known-issues |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.0-alpha.16 | 44 | 10/21/2026 |
| 10.0.0-alpha.15 | 117 | 10/11/2026 |
| 10.0.0-alpha.14 | 142 | 10/2/2026 |
| 10.0.0-alpha.13 | 134 | 9/29/2026 |
| 10.0.0-alpha.12 | 147 | 9/25/2026 |
| 10.0.0-alpha.11 | 152 | 9/15/2026 |
| 10.0.0-alpha.10 | 158 | 9/6/2026 |
| 10.0.0-alpha.9 | 160 | 8/31/2026 |
| 10.0.0-alpha.8 | 173 | 8/14/2026 |
| 10.0.0-alpha.7 | 178 | 8/13/2026 |
| 10.0.0-alpha.6 | 175 | 8/11/2026 |
| 10.0.0-alpha.5 | 172 | 8/10/2026 |
| 10.0.0-alpha.4 | 157 | 8/10/2026 |
| 3.0.0-alpha.216 | 167 | 6/30/2026 |
| 3.0.0-alpha.215 | 162 | 6/23/2026 |
| 3.0.0-alpha.214 | 167 | 6/23/2026 |
| 3.0.0-alpha.208 | 164 | 6/11/2026 |
| 3.0.0-alpha.207 | 164 | 6/11/2026 |
| 3.0.0-alpha.205 | 164 | 6/10/2026 |
| 3.0.0-alpha.204 | 167 | 6/8/2026 |
Release notes and versioning policy: https://docs.excalibur-dispatch.dev/docs/migration/version-upgrades