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.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
basic_auth | array of any | no | — | HTTP Basic Authentication credentials (username, password). For consumers: validates incoming requests. For publishers: adds Authorization header. |
batch_concurrency | integer | no | — | (Publisher only) The number of concurrent HTTP requests to send in a batch. Defaults to 20. |
compression | none | gzip | lz4 | zstd | no | none | (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_enabled | boolean | no | — | Turns 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_bytes | integer | no | null | Minimum message size in bytes to compress. Messages smaller than this are sent uncompressed. Defaults to 1024 bytes. |
concurrency_limit | integer | no | — | (Consumer only) Maximum number of concurrent requests to handle. Defaults to 100. |
custom_headers | object | no | — | Custom headers as key-value pairs (e.g., {“X-API-Key”: “token123”}). Added to outgoing HTTP headers for both consumers and publishers. |
fire_and_forget | boolean | no | false | (Consumer only) If true, respond immediately with 202 Accepted without waiting for downstream processing. Defaults to false. |
inline_response_fast_path | boolean | no | true | (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_size | integer | no | — | (Consumer only) Internal buffer size for the channel. Defaults to 100. |
message_id_header | string | no | — | (Consumer only) Header key to extract the message ID from. Defaults to “message-id”. |
method | string | no | — | (Optional) HTTP method. For publishers: the method to use (defaults to POST). For consumers: restrict to this method (others return 405). |
path | string | no | — | (Consumer only) Optional request path filter. If set, only requests whose URI path matches exactly are delivered to this consumer. |
pool_idle_timeout_ms | integer | no | — | (Publisher only) Timeout for idle connections in the connection pool in milliseconds. Defaults to 90000ms. |
receive_streamable | boolean | no | false | (Consumer only) If true, read request bodies as a stream and emit each received stream item as a separate message. |
request_timeout_ms | integer | no | — | Timeout 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_protocol | auto | http1_only | http2_only | no | auto | (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. |
shared | boolean | no | true | (Publisher only) Share one HTTP client per connection (default: true); false forces a dedicated client. |
stream_response_to | object | no | — | (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_ms | integer | no | — | (Publisher only) TCP keepalive timeout for the underlying connection pool in milliseconds. Defaults to 60000ms. |
tls | object | no | see below | TLS configuration. |
url | string | yes | — | For consumers, the listen address (e.g., “0.0.0.0:8080”). For publishers, the target URL. |
workers | integer | no | — | (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()
};
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
accept_invalid_certs | boolean | no | false | If true, disable server certificate verification (insecure). |
ca_file | string | no | — | Path to the CA certificate file. |
cert_file | string | no | — | Path to the client certificate file (PEM). |
cert_password | string | no | — | Password for the private key (if encrypted). |
key_file | string | no | — | Path to the client private key file (PEM). |
required | boolean | no | false | If true, enable TLS/SSL. |