pub struct HttpConfig {Show 17 fields
pub url: String,
pub path: Option<String>,
pub method: Option<String>,
pub tls: TlsConfig,
pub workers: Option<usize>,
pub message_id_header: Option<String>,
pub request_timeout_ms: Option<u64>,
pub internal_buffer_size: Option<usize>,
pub fire_and_forget: bool,
pub batch_concurrency: Option<usize>,
pub tcp_keepalive_ms: Option<u64>,
pub pool_idle_timeout_ms: Option<u64>,
pub compression_enabled: bool,
pub compression_threshold_bytes: Option<usize>,
pub concurrency_limit: Option<usize>,
pub basic_auth: Option<(String, String)>,
pub custom_headers: HashMap<String, String>,
}Expand description
General HTTP connection configuration.
Fields§
§url: StringFor consumers, the listen address (e.g., “0.0.0.0:8080”). For publishers, the target URL.
path: Option<String>(Consumer only) Optional request path filter. If set, only requests whose URI path matches exactly are delivered to this consumer.
method: Option<String>(Optional) HTTP method. For publishers: the method to use (defaults to POST). For consumers: restrict to this method (others return 405).
tls: TlsConfigTLS configuration.
workers: Option<usize>(Consumer only) Number of worker threads to use. Defaults to 0 for unlimited.
message_id_header: Option<String>(Consumer only) Header key to extract the message ID from. Defaults to “message-id”.
request_timeout_ms: Option<u64>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.
internal_buffer_size: Option<usize>(Consumer only) Internal buffer size for the channel. Defaults to 100.
fire_and_forget: bool(Consumer only) If true, respond immediately with 202 Accepted without waiting for downstream processing. Defaults to false.
batch_concurrency: Option<usize>(Publisher only) The number of concurrent HTTP requests to send in a batch. Defaults to 20.
tcp_keepalive_ms: Option<u64>(Publisher only) TCP keepalive timeout for the underlying connection pool in milliseconds. Defaults to 60000ms.
pool_idle_timeout_ms: Option<u64>(Publisher only) Timeout for idle connections in the connection pool in milliseconds. Defaults to 90000ms.
compression_enabled: boolEnable gzip compression for request/response bodies exceeding the threshold. Defaults to false.
compression_threshold_bytes: Option<usize>Minimum message size in bytes to compress. Messages smaller than this are sent uncompressed. Defaults to 1024 bytes.
concurrency_limit: Option<usize>HTTP Basic Authentication credentials (username, password). For consumers: validates incoming requests. For publishers: adds Authorization header. (Consumer only) Maximum number of concurrent requests to handle. Defaults to 100.
basic_auth: Option<(String, String)>§custom_headers: HashMap<String, String>Custom headers as key-value pairs (e.g., {“X-API-Key”: “token123”}). Added to outgoing HTTP headers for both consumers and publishers.
Implementations§
Source§impl HttpConfig
impl HttpConfig
Trait Implementations§
Source§impl Clone for HttpConfig
impl Clone for HttpConfig
Source§fn clone(&self) -> HttpConfig
fn clone(&self) -> HttpConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more