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

Redis Streams

Schemes: redis://, rediss://, redis+unix://, valkey://, valkeys://, valkey+unix://

Query parameters recognised as config fields for this connector. The object-typed tls is set with a JSON literal, e.g. ?tls={...}. Any other ?key=value pair is passed through unchanged as a driver option on the connection URL.

NameTypeRequiredDefaultDescription
approx_trimbooleanno—(Publisher) Use approximate (~) trimming when maxlen is set. Defaults to true.
block_msintegerno—(Consumer) Block timeout in milliseconds for each read. Defaults to 5000ms.
consumer_namestringno—(Consumer) Consumer name within the group. Defaults to a unique per-instance id.
groupstringno—(Consumer) Group name. Defaults to {APP_NAME}-{stream}; ignored in subscriber_mode.
internal_buffer_sizeintegerno—Internal buffer size for the consumer channel. Defaults to 128.
maxlenintegerno—(Publisher) If set, cap the stream length with XADD MAXLEN.
passwordstringno—Optional password for authentication.
read_from_startbooleannofalse(Consumer) On group creation, start from the stream beginning (“0”) not “$”. Default false.
reader_connectionsintegerno—(Consumer) Parallel XREADGROUP reader connections fanned out across the group. Default 1. Ignored in subscriber_mode.
redelivery_timeout_msintegerno—(Consumer) Redeliver entries pending ≥ this long via XAUTOCLAIM; 0 disables. Default 60000ms.
streamstringno—The stream key to publish to or read from. Defaults to the route name.
subscriber_modebooleannofalse(Consumer) Read ephemerally via XREAD from new messages (no group/acks). Default false.
tlsobjectnosee belowTLS: a private CA in ca_file, a client certificate in cert_file and key_file.
urlstringyes—Redis URL, redis:// or rediss:// for TLS. Userinfo is treated as a secret.
usernamestringno—Optional username for authentication (Redis ACL).

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.