Kafka
Schemes: kafka://
Query parameters recognised as config fields for this connector. The object-typed tls is set with a JSON literal, e.g. ?tls={...}. Unrecognised parameters are not forwarded as driver options, so any other ?key=value pair is rejected rather than silently ignored.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
consumer_options | array of array of any | no | null | (Consumer only) Additional librdkafka consumer configuration options (key-value pairs). |
delayed_ack | boolean | no | false | (Publisher only) If true, do not wait for an acknowledgement when sending to broker. Defaults to false. |
group_id | string | no | — | (Consumer only) Consumer group ID. If not provided, the consumer acts in Subscriber mode: it generates a unique, ephemeral group ID and starts consuming from the latest offset. |
partition_key | string | no | null | (Publisher only) Name of a metadata field whose value is used as the Kafka record key (drives partitioning/ordering). Unset, or absent on a given message, falls back to the message id. Default unset. |
partitions | integer | no | 6 | (Publisher only) Partition count used when auto-creating the topic (default: 6). Higher values raise write/consume parallelism; ordering is only guaranteed per partition key (message_id), not across the whole topic. Ignored if the topic exists. |
password | string | no | — | Optional password for SASL authentication. |
producer_options | array of array of any | no | null | (Publisher only) Additional librdkafka producer configuration options (key-value pairs). |
shared | boolean | no | true | (Publisher only) Share one producer per connection (default: true); false gives a dedicated producer. |
tls | object | no | see below | TLS configuration. |
topic | string | no | — | The Kafka topic to produce to or consume from. |
url | string | yes | — | Comma-separated list of Kafka broker URLs. If it contains userinfo, it will be treated as a secret. |
username | string | no | — | Optional username for SASL authentication. |
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. |