46 releases
new 0.0.51 | Apr 9, 2025 |
---|---|
0.0.50 | Mar 24, 2025 |
0.0.49 | Feb 26, 2025 |
0.0.39 | Nov 25, 2024 |
0.0.13 | Mar 28, 2024 |
#692 in HTTP server
264 downloads per month
Used in 2 crates
17KB
415 lines
Quick Microservices Kafka - qm-kafka
utilities to work with Kafka events
Description
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.
Usage
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()?;
Variables and Defaults
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" |
Dependencies
~14–21MB
~242K SLoC