Aid.Microservice.Shared 2.3.0

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

Aid.Microservice.Shared

Shared models, attributes, and protocols for the Aid.Microservice ecosystem.

This package is referenced by both Aid.Microservice.Server and Aid.Microservice.Client and does not need to be installed directly in most cases.

Attributes

[Microservice]

Marks a class as an RPC service.

[Microservice]                                             // name: class name without "Service" suffix
[Microservice("custom_name")]                              // explicit name
[Microservice(SerializerType = typeof(NamekoSerializer))]  // per-service serializer
[Microservice(ExchangeName = "my_rpc")]                    // explicit exchange
[Microservice(Exchanges = ["aid_rpc", "nameko-rpc"])]      // multiple exchanges

[RpcCallable]

Marks a method as an RPC endpoint.

[RpcCallable]                                            // name: method name (lowercase)
[RpcCallable("alias")]                                   // explicit name
[RpcCallable(SerializerType = typeof(NamekoSerializer))] // per-method serializer

Protocols

IRpcProtocol

Defines the messaging protocol (exchange type, exchange name, serializer).

Property Description
ExchangeType RabbitMQ exchange type (Topic, Direct, etc.)
DefaultExchangeName Suggested exchange name
DefaultSerializer IRequestSerializer used for message body

Built-in implementations:

  • DefaultJsonProtocol — .NET ↔ .NET (Topic, aid_rpc)
  • NamekoProtocol — .NET ↔ Python Nameko (Topic, nameko-rpc)

IRequestSerializer

Handles serialization/deserialization of RPC message bodies.

Member Description
ContentType MIME type (e.g. application/json)
ExchangeName Suggested exchange name for this serializer
CreateRequest() Serialize request body
ParseRequest() Deserialize incoming request
CreateResponse() Serialize response body
ParseResponse() Deserialize response body

Built-in implementations:

  • DefaultJsonSerializer{"Method": "...", "Parameters": {...}}
  • NamekoSerializer{"args": [...], "kwargs": {...}, "context_data": {...}}

Models

RpcRequest

Parsed incoming request.

public record RpcRequest
{
    public string Method { get; init; }
    public Dictionary<string, JsonElement>? Parameters { get; init; }
}

RpcResponse

RPC call result.

public record RpcResponse
{
    public object? Result { get; init; }
    public RpcError? Error { get; set; }
    public bool IsSuccess => Error == null;
}

RpcError

Error details from server-side execution.

public record RpcError
{
    public string Message { get; }
    public string? StackTrace { get; }
    public string? ErrorType { get; }
}

RpcNamekoRequest

Wrapper for sending positional arguments to Nameko-compatible services.

new RpcNamekoRequest(1, 2, 3)                              // args only
new RpcNamekoRequest(args: [1, 2], kwargs: new { x = 10 }) // both

Configuration

RabbitMqConfiguration

public class RabbitMqConfiguration
{
    public string Hostname { get; set; } = "localhost";
    public int Port { get; set; } = 5672;
    public string Username { get; set; } = "guest";
    public string Password { get; set; } = "guest";
    public string? ExchangeName { get; set; }
    public int RetryCount { get; set; } = 3;
    public int RecoveryInterval { get; set; } = 5;
}
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 (2)

Showing the top 2 NuGet packages that depend on Aid.Microservice.Shared:

Package Downloads
Aid.Microservice.Client

A lightweight RPC client library for communicating with Aid.Microservice services over RabbitMQ. Supports multiple protocols (including Nameko/Python), per-client serializers, and efficient connection pooling.

Aid.Microservice.Server

A .NET library for building RPC microservices over RabbitMQ with support for multiple protocols and per-method serializers. Features declarative attributes, DI, async/await, and Nameko (Python) interoperability.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.3.0 116 4/11/2026
2.2.0 121 4/10/2026
2.1.0 145 12/28/2025
2.0.0 139 12/28/2025
1.0.1 318 7/20/2025
1.0.0 145 7/19/2025