![]() |
VOOZH | about |
dotnet add package Raycynix.Extensions.Messaging.Grpc --version 1.0.1
NuGet\Install-Package Raycynix.Extensions.Messaging.Grpc -Version 1.0.1
<PackageReference Include="Raycynix.Extensions.Messaging.Grpc" Version="1.0.1" />
<PackageVersion Include="Raycynix.Extensions.Messaging.Grpc" Version="1.0.1" />Directory.Packages.props
<PackageReference Include="Raycynix.Extensions.Messaging.Grpc" />Project file
paket add Raycynix.Extensions.Messaging.Grpc --version 1.0.1
#r "nuget: Raycynix.Extensions.Messaging.Grpc, 1.0.1"
#:package Raycynix.Extensions.Messaging.Grpc@1.0.1
#addin nuget:?package=Raycynix.Extensions.Messaging.Grpc&version=1.0.1Install as a Cake Addin
#tool nuget:?package=Raycynix.Extensions.Messaging.Grpc&version=1.0.1Install as a Cake Tool
Raycynix.Extensions.Messaging.Grpc contains the direct gRPC transport for Raycynix messaging.
AddGrpc(...)AddGrpcUnary<TGrpcClient, TRequest, TResponse>(...)GrpcDirectMessagingConfigurationIGrpcRequestClientGrpc.Net.ClientExample appsettings.json:
{
"GrpcDirectMessagingConfiguration": {
"Address": "https://catalog-service"
}
}
Register the transport and map logical destinations to unary gRPC calls:
builder.Services.AddRaycynixMessaging(builder.Configuration)
.AddGrpc(builder.Configuration)
.AddGrpcUnary<Catalog.CatalogClient, GetCatalogItemRequest, CatalogItemReply>(
"catalog/get-item",
static async (client, request, cancellationToken) =>
await client.GetItemAsync(request, cancellationToken: cancellationToken));
Send a direct request:
public class CatalogGateway(
IRequestEnvelopeFactory envelopeFactory,
IGrpcRequestClient requestClient)
{
public async Task<CatalogItemReply> GetItemAsync(string sku, CancellationToken cancellationToken)
{
var request = envelopeFactory.Create(
new GetCatalogItemRequest { Sku = sku },
destination: "catalog/get-item",
format: MessageFormat.Grpc);
var response = await requestClient.SendAsync<GetCatalogItemRequest, CatalogItemReply>(
request,
cancellationToken);
return response.Response;
}
}
Notes:
destination is a logical operation key, not a URL| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
See the package-local CHANGELOG.md for the full change history. Override PackageReleaseNotes in the package project file for major release-specific notes.