Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

gRPC

Schemes: grpc://, grpcs://

Query parameters recognised as config fields for this connector. The object-typed binary_metadata is set with a JSON literal, e.g. ?binary_metadata={...}. Unrecognised parameters are not forwarded as driver options, so any other ?key=value pair is rejected rather than silently ignored.

NameTypeRequiredDefaultDescription
api_keystringno—API key sent as api_key_name (default x-api-key) on dynamic calls and the reflection RPC.
api_key_namestringno—Metadata key used for api_key. Defaults to x-api-key.
bearer_tokenstringno—Bearer token sent as authorization on dynamic calls and the reflection RPC; rejected in Bridge/server mode.
binary_metadataobjectno—Static binary metadata for dynamic calls and the reflection RPC. Keys must end in -bin; each value is raw bytes, written as a JSON array of byte values 0-255 (the only accepted form — a base64 or text string is rejected). As a URL parameter: ?binary_metadata=%7B%22x-trace-bin%22%3A%5B1%2C2%2C3%5D%7D, which is {"x-trace-bin": [1, 2, 3]} percent-encoded.
concurrency_limit_per_connectionintegernonullMaximum number of concurrent requests handled per connection. Server-mode only.
connect_timeout_msintegernonullMaximum time to establish a client connection.
consumer_idstringnonullStable subscription identity used for ACK tracking and redelivery. Defaults to a fresh id per consumer; set it to be redelivered unacknowledged messages on reconnect.
descriptor_set_bytesarray of integerno—Compiled protobuf FileDescriptorSet bytes for embedded callers. Takes precedence over descriptor_set_path and avoids writing a temporary descriptor file.
descriptor_set_pathstringnonullCompiled protobuf FileDescriptorSet for dynamic calls or a served method.
http2_keepalive_interval_msintegernonullHTTP/2 keepalive ping interval in milliseconds. Applies in both modes. Default disabled
http2_keepalive_timeout_msintegernonullTimeout for a keepalive ping acknowledgement in milliseconds. Applies in both modes.
idle_stream_timeout_msintegernonullMaximum time a dynamic response stream may remain idle between messages.
initial_connection_window_sizeintegernonullHTTP/2 connection-level initial window size in bytes. Applies in both modes.
initial_stream_window_sizeintegernonullHTTP/2 stream-level initial window size in bytes. Applies in both modes.
max_decoding_message_sizeintegernonullMaximum size of a decoded incoming message in bytes. Applies in both modes. Default 4 MiB.
max_encoding_message_sizeintegernonullMaximum size of an encoded outgoing message in bytes. Default unlimited.
metadataobjectno—Static ASCII metadata attached to dynamic RPCs and to the reflection RPC that fetches their descriptors. Values for keys that look sensitive are extracted by mq-bridge’s normal secret handling.
method_namestringnonullRPC method name for dynamic calls or a served unary method.
overall_timeout_msintegernonullMaximum lifetime of a dynamic RPC; exceeding it stops the route instead of reconnecting.
reflectionbooleannofalseDiscover descriptors from the remote gRPC server reflection v1 service.
requestanynonullJSON request mapped to the dynamic protobuf input message.
request_timeout_msintegernonullMaximum time to establish an RPC and receive its initial response.
server_modebooleannofalseIf true, start an embedded tonic gRPC server that accepts Publish / PublishBatch RPCs, plus one descriptor-defined unary method when method_name is set. If false (the default), connect to a remote server as a client.
server_streamingbooleannofalseDeprecated compatibility hint. Dynamic RPC shape is always derived from the descriptor.
service_namestringnonullFully-qualified protobuf service name for dynamic calls or a served method.
sharedbooleannotrue(Publisher only) Share one gRPC channel per connection (default: true); false forces a dedicated channel.
timeout_msintegerno—Deprecated compatibility timeout in milliseconds. Used as the fallback for connection and initial-request deadlines. Prefer the dedicated settings.
tlsobjectnosee belowTLS configuration.
topicstringno—Topic / subject used for both subscribe and publish paths.
urlstringyes—The gRPC server URL (e.g., “http://localhost:50051” for client or “0.0.0.0:50051” for server mode).

Struct-typed fields

tls

TLS configuration for secure connections.

Configures Transport Layer Security (TLS/SSL) for encrypted communication. Supports both client certificate (mutual TLS) and server certificate validation.

Examples

use mq_bridge::models::TlsConfig;

let tls = TlsConfig {
    required: true,
    ca_file: Some("/path/to/ca.pem".to_string()),
    cert_file: Some("/path/to/cert.pem".to_string()),
    key_file: Some("/path/to/key.pem".to_string()),
    ..Default::default()
};
NameTypeRequiredDefaultDescription
accept_invalid_certsbooleannofalseIf true, disable server certificate verification (insecure).
ca_filestringno—Path to the CA certificate file.
cert_filestringno—Path to the client certificate file (PEM).
cert_passwordstringno—Password for the private key (if encrypted).
key_filestringno—Path to the client private key file (PEM).
requiredbooleannofalseIf true, enable TLS/SSL.