RabbitRpc.Serialization.SystemTextJson 4.0.0

dotnet add package RabbitRpc.Serialization.SystemTextJson --version 4.0.0
                    
NuGet\Install-Package RabbitRpc.Serialization.SystemTextJson -Version 4.0.0
                    
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="RabbitRpc.Serialization.SystemTextJson" Version="4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RabbitRpc.Serialization.SystemTextJson" Version="4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="RabbitRpc.Serialization.SystemTextJson" />
                    
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 RabbitRpc.Serialization.SystemTextJson --version 4.0.0
                    
#r "nuget: RabbitRpc.Serialization.SystemTextJson, 4.0.0"
                    
#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 RabbitRpc.Serialization.SystemTextJson@4.0.0
                    
#: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=RabbitRpc.Serialization.SystemTextJson&version=4.0.0
                    
Install as a Cake Addin
#tool nuget:?package=RabbitRpc.Serialization.SystemTextJson&version=4.0.0
                    
Install as a Cake Tool

RabbitRpc.Serialization.SystemTextJson

System.Text.Json IRpcSerializer adapter for RabbitRpc. One of three serialization adapters available for RabbitRpc 4.x — pick this one for JSON on the wire (debugging, legacy interop, or compatibility with v3 JSON payload shape). For high-throughput production traffic prefer a binary adapter.

Installation

dotnet add package RabbitRpc.Serialization.SystemTextJson
dotnet add package RabbitRpc.Client     # or RabbitRpc.Server

Pack for NuGet

dotnet pack -c Release

This package is a sidecar to RabbitRpc.Client / RabbitRpc.Server — install one (or both) of those alongside it.

Configuration

Server:

using AsbtCore.Broker.Server;
using AsbtCore.Broker.Serialization.SystemTextJson;

services.AddRabbitRpcServer(configuration)
        .UseJsonRpcSerialization()
        .Register<IGreeter, GreeterService>();

Client:

using AsbtCore.Broker.Client;
using AsbtCore.Broker.Serialization.SystemTextJson;

services.AddRabbitRpcClient(configuration)
        .UseJsonRpcSerialization()
        .AddProxy<IGreeter>();

ContentType published on BasicProperties is application/json. Argument and result fragments are emitted as base64-encoded JSON strings.

Custom options

Both UseJsonRpcSerialization extensions accept an optional configure callback for tuning JsonSerializerOptions:

.UseJsonRpcSerialization(o =>
{
    o.WriteIndented = false;
    o.Converters.Add(new MyDomainConverter());
});

Base options are produced by RpcJson.Build() — camelCase, case-insensitive property matching, null-write skipped, plus the ReadOnlyMemoryByteJsonConverter. Call RpcJson.Build() directly if you need the defaults without DI.

DTO requirements

None beyond what System.Text.Json already requires. DTOs are reflected at runtime — plain classes, records, init-only properties, and IEnumerable<T> collections all work. No source generator, no Touch<T> call sites, no AOT-time codegen step.

Wire format & performance

  • JSON envelope, application/json content type.
  • Per-argument and per-result fragments are base64-encoded JSON strings — adds ~33 % size overhead vs raw bytes.
  • Deserialization allocates a fresh byte[] per ReadOnlyMemory<byte> property; the contract guarantees decoded payloads remain valid after the source buffer is reused.
  • Not zero-copy. Throughput-sensitive workloads should use a binary adapter.

Limitations

  • Base64-on-the-wire makes payloads larger and somewhat slower than v3 raw JSON — this is intentional, since v4 fragment payloads are arbitrary bytes (ReadOnlyMemory<byte>), and base64 is the canonical JSON-safe encoding.
  • AOT/trim require manual JsonSerializerContext registration through the configure callback.

See Also

License

MIT

Product 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. 
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
4.0.0 94 5/15/2026

v4.0.0 — Unified release under the RabbitRpc 4.x line.
- First release of the SystemTextJson adapter against the IRpcSerializer v4 surface (SerializeEnvelope / DeserializeEnvelope / SerializeFragment / DeserializeFragment).
- Drop-in shape for v3 JSON wire — DTOs reflected at runtime, no source generator step.
- ReadOnlyMemoryByteJsonConverter emits per-fragment payloads as base64-encoded JSON strings.
- Compatible with RabbitRpc.Client 4.x and RabbitRpc.Server 4.x.