Mediarq.Grpc 1.5.1

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

Mediarq.Grpc

gRPC transport for cross-service Mediarq notifications: forward a notification to another service's Mediarq gRPC endpoint when it is published, and receive it back into the real Mediarq pipeline via a single shared gRPC service. Ships its own compiled Protobuf/gRPC contract — reference this package only, no protoc/Grpc.Tools required on your side.

dotnet add package Mediarq.Grpc

Marking an event

public sealed record OrderPlaced(Guid OrderId, string Customer) : IGrpcNotificationEvent
{
    public static string ServiceAddress => "https://order-service:5001";
}

ServiceAddress is a static abstract member, not an instance property: the publish side needs this routing information available before any OrderPlaced instance exists, and reading it from the type rather than an instance keeps it impossible for two instances of the same notification type to accidentally target different remote services.

Publishing (outbound)

builder.Services.AddMediarqGrpcPublisher<OrderPlaced>();

Now every IPublisher.Publish(new OrderPlaced(...)) call also calls OrderPlaced.ServiceAddress's NotificationService.Publish RPC, in addition to running any in-process handlers. The HTTP/2 channel to each ServiceAddress is cached and reused (not one per publish) and disposed when the app shuts down — unlike the Dapr/RabbitMQ/Azure Service Bus packages, this package owns that channel's lifecycle itself, since (unlike a Dapr sidecar client, a RabbitMQ connection, or a Service Bus client) it carries no external credentials your app needs to configure.

Subscribing (inbound)

builder.Services.AddMediarqGrpcSubscriptions();
// ...
app.MapMediarqGrpcNotificationService();     // map exactly once
app.MapMediarqGrpcSubscription<OrderPlaced>();

Every subscribed notification type is multiplexed over the single shared gRPC service — there is one RPC method (Publish), and the envelope's type_name field tells the receiving service which registered type to deserialize the JSON payload as and republish through IPublisher. A gRPC call for a type that was never subscribed on this service fails with StatusCode.NotFound.

What this does not do

Unlike a message broker (Dapr pub/sub, RabbitMQ, Azure Service Bus), gRPC is direct point-to-point RPC: the publisher must know the target service's network address, there is no fan-out, no persistence, and no retry/redelivery if the remote service is unreachable — a failed Publish RPC throws Grpc.Core.RpcException, same as any other Mediarq notification handler exception. If you need broker semantics (decoupled publisher/subscriber, delivery guarantees, dead-lettering), use one of the other transport packages instead.

Learn more

Wiring extensions · Full README · gRPC for .NET docs

MIT © Nicolas Rouffart

Product 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. 
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
1.5.1 233 7/26/2026
1.5.0 116 7/26/2026