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

HTTP

Schemes: http://, https://

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

NameTypeRequiredDefaultDescription
basic_autharray of anynoHTTP Basic Authentication credentials (username, password). For consumers: validates incoming requests. For publishers: adds Authorization header.
batch_concurrencyintegerno(Publisher only) The number of concurrent HTTP requests to send in a batch. Defaults to 20.
compressionnone | gzip | lz4 | zstdnonone(Publisher only) Codec for the request body (none, gzip, lz4, zstd); overrides compression_enabled. lz4 is non-standard (mq-bridge peers only). Ignored on a consumer — enable response compression with compression_enabled. Defaults to none.
compression_enabledbooleannoTurns compression on. Publisher: compress the request body with gzip (unless compression sets another codec). Consumer: compress responses, negotiating the best codec the client’s Accept-Encoding accepts. Defaults to off.
compression_threshold_bytesintegernonullMinimum message size in bytes to compress. Messages smaller than this are sent uncompressed. Defaults to 1024 bytes.
concurrency_limitintegerno(Consumer only) Maximum number of concurrent requests to handle. Defaults to 100.
custom_headersobjectnoCustom headers as key-value pairs (e.g., {“X-API-Key”: “token123”}). Added to outgoing HTTP headers for both consumers and publishers.
fire_and_forgetbooleannofalse(Consumer only) If true, respond immediately with 202 Accepted without waiting for downstream processing. Defaults to false.
inline_response_fast_pathbooleannotrue(Consumer only) If true, compatible http -> response routes may bypass the normal route consumer/worker/disposition pipeline and reply inline for lower latency. Defaults to true. Set to false to force the normal route path.
internal_buffer_sizeintegerno(Consumer only) Internal buffer size for the channel. Defaults to 100.
message_id_headerstringno(Consumer only) Header key to extract the message ID from. Defaults to “message-id”.
methodstringno(Optional) HTTP method. For publishers: the method to use (defaults to POST). For consumers: restrict to this method (others return 405).
pathstringno(Consumer only) Optional request path filter. If set, only requests whose URI path matches exactly are delivered to this consumer.
pool_idle_timeout_msintegerno(Publisher only) Timeout for idle connections in the connection pool in milliseconds. Defaults to 90000ms.
receive_streamablebooleannofalse(Consumer only) If true, read request bodies as a stream and emit each received stream item as a separate message.
request_timeout_msintegernoTimeout for HTTP requests in milliseconds. For consumers, it’s the request-reply timeout. For publishers, it’s the timeout for each individual request. Defaults to 30000ms.
server_protocolauto | http1_only | http2_onlynoauto(Consumer only) Restrict which HTTP protocol versions a server listener accepts. Defaults to auto (HTTP/1.1 + HTTP/2). On cleartext listeners, http2_only means HTTP/2 prior-knowledge (h2c) only.
sharedbooleannotrue(Publisher only) Share one HTTP client per connection (default: true); false forces a dedicated client.
stream_response_toobjectno(Publisher only) Optional endpoint that receives streamed HTTP response items as correlated messages. Use a stream_buffer endpoint here when callers need to read streamed response items later through a normal mq-bridge consumer. Each streamed item is published with correlation_id, http_stream_id, http_stream_index, http_stream_format, and http_stream_end metadata. If the request message has no correlation_id, the HTTP publisher uses format!("{:032x}", request.message_id) so callers can derive the consumer correlation id before calling send.
tcp_keepalive_msintegerno(Publisher only) TCP keepalive timeout for the underlying connection pool in milliseconds. Defaults to 60000ms.
tlsobjectnosee belowTLS configuration.
urlstringyesFor consumers, the listen address (e.g., “0.0.0.0:8080”). For publishers, the target URL.
workersintegerno(Consumer only) Number of worker threads to use. Defaults to 0 for unlimited.

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_filestringnoPath to the CA certificate file.
cert_filestringnoPath to the client certificate file (PEM).
cert_passwordstringnoPassword for the private key (if encrypted).
key_filestringnoPath to the client private key file (PEM).
requiredbooleannofalseIf true, enable TLS/SSL.