Class GrpcBuilder

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

Fluent builder for gRPC endpoint URIs. Scheme: grpc.

public sealed class GrpcBuilder

Inheritance

Object→GrpcBuilder

Methods

AllowClientReservedHeaders(bool)

Accept caller headers carrying a transport-reserved prefix (redbGrpc., redbHttp., …).

public GrpcBuilder AllowClientReservedHeaders(bool value = true)

Build()

Builds the endpoint URI.

public string Build()

ClientCertificate(string, string?)

Client certificate presented to the server (mTLS, producer side).

public GrpcBuilder ClientCertificate(string pfxPath, string? password = null)

ClientCertificates(GrpcClientCertificateMode, params string[])

Require or allow a client certificate (mTLS); needs .Ssl(). Optionally pins the accepted

public GrpcBuilder ClientCertificates(GrpcClientCertificateMode mode = GrpcClientCertificateMode.RequireCertificate, params string[] allowedThumbprints)

Compression(GrpcCompression)

Reply compression (server) / request compression (client). Requests are always decoded.

public GrpcBuilder Compression(GrpcCompression codec)

ConnectionFactory(string)

References a named from the route registry instead of putting the certificate password in the URI.

public GrpcBuilder ConnectionFactory(string name)

Deadline(IExpression)

Deadline from an expression (resolves to int milliseconds).

public GrpcBuilder Deadline(IExpression expr)

Deadline(int)

Deadline timeout in ms. Default 30000.

public GrpcBuilder Deadline(int ms)

EmitHttpCompatHeaders(bool)

Mirror the client address into redbHttp.RemoteAddress as well, so processors written

public GrpcBuilder EmitHttpCompatHeaders(bool value = true)

Envelope(GrpcEnvelopeMode)

Body handling. Auto (default) uses the generic RedbMessage envelope only for the

public GrpcBuilder Envelope(GrpcEnvelopeMode mode)

Health(bool)

Also serve grpc.health.v1.Health/Check on this host:port.

public GrpcBuilder Health(bool value = true)

Host(string)

Bind host for consumer. Default 0.0.0.0.

public GrpcBuilder Host(string host)

InOut(bool)

Enable request-response pattern. Default true for gRPC.

public GrpcBuilder InOut(bool value = true)

MaxConcurrentRequests(int, int)

Admission limit for UNARY calls: at most max concurrent pipeline

public GrpcBuilder MaxConcurrentRequests(int max, int queue = 0)

MaxMessageSize(int)

One limit for send, receive and server request sizes (camel-grpc's maxMessageSize).

public GrpcBuilder MaxMessageSize(int bytes)

MaxReceiveMessageSize(int)

Max receive message size in bytes.

public GrpcBuilder MaxReceiveMessageSize(int bytes)

MaxRequestMessageSize(int)

Max request message size for consumer.

public GrpcBuilder MaxRequestMessageSize(int bytes)

MaxSendMessageSize(int)

Max send message size in bytes.

public GrpcBuilder MaxSendMessageSize(int bytes)

Method(string)

Full method address, /package.Service/Method. On the consumer this is the route key, so

public GrpcBuilder Method(string methodPath)

NegotiationType(string)

Channel security, camel-grpc style: PLAINTEXT or TLS.

public GrpcBuilder NegotiationType(string type)

Plaintext(bool)

Use plaintext (no TLS). Default true.

public GrpcBuilder Plaintext(bool value = true)

Port(int)

Bind port for consumer.

public GrpcBuilder Port(int port)

RejectStatusCode(int)

HTTP status code for a shed request (default 429).

public GrpcBuilder RejectStatusCode(int statusCode)

RetryAfterSeconds(int)

Retry-After value for a shed request in seconds; 0 = do not send (default 1).

public GrpcBuilder RetryAfterSeconds(int seconds)

Service(string, string?)

Service plus method, camel-grpc style (grpc://host:port/my.Service?method=Call). Equivalent

public GrpcBuilder Service(string service, string? method = null)

Ssl()

Enable SSL for consumer.

public GrpcBuilder Ssl()

SslCertPassword(string)

SSL certificate password.

public GrpcBuilder SslCertPassword(string password)

SslCertPath(string)

Path to SSL certificate.

public GrpcBuilder SslCertPath(string path)

Streaming(bool)

Serve this address as a server-streaming method: an IAsyncEnumerable reply body is written

public GrpcBuilder Streaming(bool value = true)

SuppressStatusMapping(bool)

Never translate a route's status.code into a gRPC status; always answer OK and let the

public GrpcBuilder SuppressStatusMapping(bool value = true)

ThrowOnError(bool)

Throw when the call fails, so .OnException(...), retry and dead-letter see it — the same

public GrpcBuilder ThrowOnError(bool value = true)

ToString()

Returns a string that represents the current object.

public override string ToString()