RabbitRpc.Client 4.0.1

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

RabbitRpc.Client

Client-side library for RabbitMQ RPC on .NET 10. Define a contract interface, register a typed proxy in DI, and call its methods like any local service — the request is sent via RabbitMQ and the response is awaited from the server.

v4.0 introduces a pluggable serialization layer — you must pair this package with one of the adapter packages:

Installation

dotnet add package RabbitRpc.Client
dotnet add package RabbitRpc.Serialization.XPacketRpc      # or .MemoryPack / .SystemTextJson

Pack for NuGet

dotnet pack -c Release

Configuration

Add the RabbitMqRpc section to appsettings.json:

{
  "RabbitMqRpc": {
    "HostName": "localhost",
    "Port": 5672,
    "VirtualHost": "/",
    "UserName": "guest",
    "Password": "guest",
    "ClientProvidedName": "rabbit-rpc-client",
    "RoutePrefix": "rpc.",
    "PrefetchCount": 1,
    "DefaultTimeoutSeconds": 30
  }
}

Usage

Define a contract interface (shared between client and server, no CancellationToken parameters — timeouts live on the transport):

public interface IMathService
{
    Task<int>     AddAsync(int a, int b);
    Task<UserDto> GetUserAsync(Guid id);
}

public sealed record UserDto(Guid Id, string Name);

Register the client and a typed proxy in Program.cs:

using AsbtCore.Broker.Client;
using AsbtCore.Broker.Serialization.XPacketRpc;   // pick one adapter

var builder = Host.CreateApplicationBuilder(args);

builder.Services
    .AddRabbitRpcClient(builder.Configuration)    // returns RpcClientBuilder
    .UseXPacketRpcSerialization()                 // required in v4.0
    .AddProxy<IMathService>();                    // was AddRpcProxy<T> in v3

Inject and use the proxy like any other DI service:

public sealed class CalculatorController(IMathService math) : ControllerBase
{
    [HttpGet("add")]
    public Task<int> Add(int a, int b) => math.AddAsync(a, b);
}

The per-call timeout defaults to RpcOptions.DefaultTimeoutSeconds; expired calls surface as TaskCanceledException. Server-side exceptions arrive as RpcRemoteException with RemoteCode / RemoteExceptionType / RemoteDetails populated.

Migration v3.x → v4.0

Was (v3.x) Now (v4.0)
AddRabbitRpcClient(cfg) returns IServiceCollection returns RpcClientBuilder
services.AddRpcProxy<T>() extension builder.AddProxy<T>() on RpcClientBuilder
Default JSON wired automatically Adapter package + .UseXxxSerialization() is required
JsonElement payload in RpcRequest ReadOnlyMemory<byte> (only matters for custom transports)

See the repo migration guide for the full break list.

See Also

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.1 93 5/20/2026
4.0.0 94 5/15/2026
3.0.0 102 5/7/2026
1.0.2 95 4/15/2026
1.0.1 94 4/14/2026
1.0.0 103 4/14/2026

v4.0.1 — Binary serialization. MINOR UPDATE.
- Wire format is incompatible with v3.x. Roll forward client and server together.
- A serialization adapter package is now REQUIRED: install either
 RabbitRpc.Serialization.XPacketRpc (binary, default) or
 RabbitRpc.Serialization.SystemTextJson (JSON, drop-in v3 compat shape).
- DI now requires '.UseXPacketRpcSerialization()' / '.UseJsonRpcSerialization()' on
 the builder returned by 'AddRabbitRpcClient(cfg)'. Startup throws if missing.
- 'AddRabbitRpcClient(cfg)' returns 'RpcClientBuilder'. Proxies register via
 '.AddProxy<T>()' (previously '.AddRpcProxy<T>()').
- 'RpcRequest.Arguments[i].Payload' / 'RpcResponse.Result' changed from
 'JsonElement' to 'ReadOnlyMemory<byte>'.
- 'IRpcSerializer' surface widened to four methods. Custom implementations must update.
See README "Migration v3.1 → v4.0".