Crates.io | qm-kafka |
lib.rs | qm-kafka |
version | 0.0.60 |
created_at | 2024-03-14 11:28:57.012592+00 |
updated_at | 2025-08-11 12:12:43.880543+00 |
description | Kafka helper functions |
homepage | |
repository | https://github.com/hd-gmbh-dev/quick-microservice-rs |
max_upload_size | |
id | 1173266 |
size | 31,469 |
qm-kafka
utilities to work with Kafka events
With this crate it is easy to get a Kafka configuration with the most common settings. It also provides common helpers for topics and defines event and event namespaces commonly used with the other features provided by this crate.
let kafka_config = qm::kafka::config::Config::new()?;
The Config
is populated with environment variables. By default, all variables with the prefix
KAFKA_
are considered.
The prefix can be changed by using a builder pattern.
let example_config = qm::kafka::config::Config::builder().with_prefix("EXAMPLE_").build()?;
These variables are available and are set with the following defaults.
variable | struct field | default |
---|---|---|
KAFKA_HOST | host | "127.0.0.1" |
KAFKA_PORT | port | 9092 |
address | {host}:{port} |
|
KAFKA_TOPIC_MUTATION_EVENTS | topic_mutation_events | "qm_mutation_events" |
KAFKA_CONSUMER_GROUP_MUTATION_EVENTS_PREFIX | consumer_group_mutation_events_prefix | "qm_consumer_group" |