qm-kafka

Crates.ioqm-kafka
lib.rsqm-kafka
version0.0.60
created_at2024-03-14 11:28:57.012592+00
updated_at2025-08-11 12:12:43.880543+00
descriptionKafka helper functions
homepage
repositoryhttps://github.com/hd-gmbh-dev/quick-microservice-rs
max_upload_size
id1173266
size31,469
(hd-gmbh-bot)

documentation

README

Quick Microservices Kafka - qm-kafka

utilities to work with Kafka events


GitHub repositoryCargo packageDocs

github.com - quick-microservice-rs crates.io - qm-kafka
github.com - workflow - build


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"
Commit count: 224

cargo fmt