Class GrpcConsumer

Namespace: redb.Route.Grpc
Assembly: redb.Route.Grpc.dll

gRPC consumer. Registers the endpoint's method address as a path route on the shared Kestrel host
and speaks the gRPC wire protocol itself (see ) — the same shape as the AS2
and SOAP consumers, which also own their protocol on top of that host.

Because the route key is the method address, many gRPC methods live on one port as ordinary routes:
From("grpc:0.0.0.0:5001/identity.v1.Identity/Token") and
From("grpc:0.0.0.0:5001/identity.v1.Identity/Introspect") are two routes with their own ids,
policies, metrics and lifecycle.

public class GrpcConsumer : IConsumer

Inheritance

Object→GrpcConsumer

Implements

Properties

BaseUrl

The base URL the gRPC server is listening on. Available after Start().

public string? BaseUrl { get; }

Endpoint

The endpoint this consumer is attached to (for diagnostics/logging).

public IEndpoint Endpoint { get; }

ProcessedCount

Number of requests successfully processed.

public long ProcessedCount { get; }

Methods

Start(CancellationToken)

Starts consuming messages.

public Task Start(CancellationToken ct = default)

Stop(CancellationToken)

Stops consuming messages.

public Task Stop(CancellationToken ct = default)

Constructors