Ir al contenido
Español

GrpcServerOptionsType

Esta página aún no está disponible en tu idioma.

Defined in: src/io/broker/GrpcServerOptions.ts:16

Common options every broker actor accepts on top of its protocol- specific options. Subclasses extend this interface with their own required fields (e.g. brokerUrl, topics).

readonly optional bind?: string

Defined in: src/io/broker/GrpcServerOptions.ts:21

Bind address ('0.0.0.0:50051').


readonly optional circuitBreaker?: object

Defined in: src/io/broker/BrokerOptions.ts:48

Optional circuit-breaker around connectImplementation. After failureThreshold consecutive failed connect attempts the breaker opens for resetMs and rejects new attempts immediately.

readonly failureThreshold: number

readonly resetMs: number

BrokerCommonOptionsType.circuitBreaker


readonly optional credentials?: { kind: "insecure"; } | { cert: Uint8Array; key: Uint8Array; kind: "tls"; rootCerts?: Uint8Array<ArrayBufferLike>; }

Defined in: src/io/broker/GrpcServerOptions.ts:28

TLS — when omitted, the server binds insecurely. For mTLS supply cert + key + (optionally) rootCerts for client auth.


readonly optional handlers?: Readonly<Record<string, GrpcHandler>>

Defined in: src/io/broker/GrpcServerOptions.ts:23

Method-name → handler mapping. Methods absent from this map are unimplemented (UNIMPLEMENTED status).


readonly optional health?: HealthCheckRegistry

Defined in: src/io/broker/GrpcServerOptions.ts:43

Serve the standard grpc.health.v1.Health service next to the user’s service, answering Check from this registry’s readiness checks — the same source the management server’s /ready endpoint aggregates.

There is deliberately no boolean toggle and no HOCON leaf: the status has to come from somewhere, and a health service that answers SERVING unconditionally is worse than none at all — a Kubernetes probe would keep the pod in rotation straight through an outage. Supplying the registry IS the opt-in, and it makes the framework carry one notion of “ready” rather than two that can disagree.


readonly optional outboundBuffer?: number

Defined in: src/io/broker/BrokerOptions.ts:61

Maximum number of outbound messages buffered while the connection is connecting or disconnected. When the buffer is full the oldest message is dropped (FIFO eviction) and a BrokerBufferOverflow event is published. Default: 1000. Set to 0 to fail-fast (publish a BrokerNotConnected event and drop the message).

BrokerCommonOptionsType.outboundBuffer


readonly optional packageName?: string

Defined in: src/io/broker/GrpcServerOptions.ts:18


readonly optional protoPath?: string | readonly string[]

Defined in: src/io/broker/GrpcServerOptions.ts:17


readonly optional reconnect?: false | { factor?: number; initialDelayMs?: number; maxAttempts?: number; maxDelayMs?: number; }

Defined in: src/io/broker/BrokerOptions.ts:35

Reconnect strategy applied when the underlying connection drops or connectImplementation throws. Default: exponential backoff starting at 200ms, doubling, capped at 30s, infinite attempts. Set to false to disable auto-reconnect (one-shot connections).

false


{ factor?: number; initialDelayMs?: number; maxAttempts?: number; maxDelayMs?: number; }

readonly optional factor?: number

readonly optional initialDelayMs?: number

readonly optional maxAttempts?: number

Cap on retry attempts. Default: Infinity (retry forever).

readonly optional maxDelayMs?: number

BrokerCommonOptionsType.reconnect


readonly optional serviceName?: string

Defined in: src/io/broker/GrpcServerOptions.ts:19