Expand description
§Kafka Producer Module
This module provides a high-level Rust API for creating and configuring Kafka producers. It wraps the lower-level WIT (WebAssembly Interface Types) bindings to offer a more ergonomic interface for publishing messages to Kafka topics.
§Quick Start
// Create a basic producer configuration
let config = KafkaProducerConfig::default();
// Connect to Kafka
let producer = kafka::producer(
"my-producer",
["localhost:9092"],
"my-topic",
config
)?;
§Authentication
The module supports multiple authentication methods:
- SASL/PLAIN: Username and password authentication
- SASL/SCRAM: SHA256 and SHA512 SCRAM mechanisms
- mTLS: Mutual TLS with client certificates
§TLS Configuration
TLS connections can be configured to use either the system’s certificate authority store or a custom CA certificate file.
Structs§
- Kafka
Authentication - Authentication configuration for Kafka connections.
- Kafka
Batch Config - Configuration options for Kafka message batching.
- Kafka
Consumer - A Kafka consumer that can receive messages from Kafka topics.
- Kafka
Consumer Config - Configuration for a Kafka consumer.
- Kafka
Message - A Kafka message containing key, value, headers, and metadata.
- Kafka
Producer - A Kafka producer client for publishing messages to Kafka topics.
- Kafka
Producer Config - Configuration options for a Kafka producer.
Enums§
- Kafka
Producer Compression - Compression algorithms available for Kafka message batches.
- Kafka
TlsConfig - TLS configuration options for Kafka connections.