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

WebSocket

Schemes: ws://, wss://

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
backlogintegerno—(Consumer only) TCP listen backlog (pending-connection queue depth) for the accept socket. Raise this if high-concurrency handshake bursts are being dropped/reset before accept() can keep up. Defaults to 4096, which is higher than the OS/tokio default of 1024.
basic_autharray of anyno—HTTP Basic credentials (username, password): a consumer requires them, a publisher sends them.
execution_modeauto | direct_only | routednoauto(Consumer only) Selects whether WebSocket routes run directly or through the routed pipeline.
max_connectionsintegerno—(Consumer only) Maximum number of concurrent connections; additional connections receive 503. Unset = no limit.
message_id_headerstringno—(Consumer only) Header key to extract the message ID from the WebSocket handshake. Defaults to “message-id”.
pathstringno—(Consumer only) Optional request path filter. If set, only upgrade requests whose URI path matches exactly are delivered to this consumer.
routed_queue_capacityintegerno—(Consumer only) Queue capacity for the routed adapter. Direct response routes do not use this queue. Defaults to 100.
tlsobjectnosee belowTLS: a consumer listens with cert_file and key_file; a publisher uses it for a wss:// URL.
urlstringyes—For consumers, the listen address (e.g. “0.0.0.0:9000”). For publishers, the target URL.

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.