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

Sends or receives messages over gRPC. As a client (default) it connects to a remote server and issues Publish / PublishBatch RPCs; as a server (server_mode=true) it starts an embedded tonic server that accepts those RPCs.

URL format

grpc://host[:port]?topic=<topic>

grpc:// (plain) and grpcs:// (TLS) are both accepted. In client mode the URL is the remote server (e.g. grpc://localhost:50051); in server mode it is the bind address (e.g. grpc://0.0.0.0:50051).

Examples

Forward a Kafka topic to a remote gRPC service, continuous:

mq-bridge-app copy \
  --from kafka://kafka.local:9092?topic=orders \
  --to grpc://orders-svc.local:50051?topic=orders

Run an embedded gRPC server that ingests into Postgres, continuous:

mq-bridge-app copy \
  --from 'grpc://0.0.0.0:50051?server_mode=true&topic=orders' \
  --to 'postgres://user:pass@localhost/app?table=orders&auto_create_table=true'

Key options

OptionPurpose
server_modeStart an embedded gRPC server (receive) instead of connecting as a client.
topicTopic / subject used for both subscribe and publish paths.
timeout_msClient: connection timeout and per-request deadline. Server: per-request deadline.
max_decoding_message_sizeServer-only: max decoded incoming message size (default 4 MiB).
http2_keepalive_interval_ms / http2_keepalive_timeout_msServer-only: HTTP/2 keepalive tuning.
tlsTLS configuration (object; set with a JSON literal ?tls={...}).

Full field list: reference/grpc.md.