ConfigGenerator

Kafka Config Generator

Generate production-oriented Apache Kafka configurations. Configure KRaft consensus, listener security, and strict topic governance for server.properties.

Output:A ready-to-use configuration file for Kafka Config with best practices applied.

Kafka Version

Broker Identity & KRaft Roles

Unique integer ID for this node (replaces broker.id).

Format: id@host:port (e.g., 1@localhost:9093,2@host2:9093).

Listeners & Network

The interfaces Kafka binds to. e.g., PLAINTEXT://0.0.0.0:9092.

The address clients use to connect. MUST be reachable by clients.

Storage & Topics

Comma-separated list of directories to store data.

Default number of partitions per topic.

Should be 3 for production.

Should be 2 for production (requires replication factor 3).

Log Retention

168 = 7 days.

Maximum size of the log before deleting. -1 means unlimited.

server.propertiesNot Generated
Not generated yet

Quick Summary

Use a Kafka Config Generator when you need server.properties, topic configuration, producer/consumer config, Spring Boot YAML, Kafka UI config, JMX settings, or MirrorMaker examples.

What is this tool?

Apache Kafka is a distributed event streaming platform. Configuration is split into several domains: broker settings (server.properties), topic settings (retention/partitions), and client settings (producer/consumer).

Kafka server.properties Options

  • broker.id: A unique integer for each broker in a cluster. If using KRaft, this is often replaced or supplemented by node.id.
  • listeners: Defines the interfaces and ports the broker binds to (e.g., PLAINTEXT://0.0.0.0:9092).
  • advertised.listeners: Crucial for external clients. This is the hostname/IP given back to the client to use for actual data transfer.
  • log.dirs: The directory where Kafka persists message logs. (e.g., /var/lib/kafka/data).
  • num.partitions: Default number of partitions for auto-created topics.
  • default.replication.factor: How many copies of a topic's data exist across brokers.
  • offsets.topic.replication.factor: Must be set correctly in multi-node clusters to ensure consumer offsets are durable.

How to Use This Tool

ZooKeeper vs. KRaft

Historically, Kafka required Apache ZooKeeper for cluster consensus (configured via zookeeper.connect). Newer versions of Kafka utilize KRaft (Kafka Raft), removing the ZooKeeper dependency. KRaft uses the process.roles and controller.quorum.voters properties instead.

Developer & Platform Configurations

  • kafka-configs.sh CLI: Used to dynamically apply topic configurations (like cleanup.policy=compact) on a live cluster.
  • Spring Boot: You can configure Kafka clients entirely in application.yml using the spring.kafka.* namespace.
  • Kafka UI ConfigMap: For observability, tools like Provectus Kafka UI can be deployed in Kubernetes using a ConfigMap containing the broker endpoints.

What This Tool Generates

  • server.properties for the broker
  • producer.properties and consumer.properties
  • Topic configuration commands
  • Spring Boot application.yml snippet
  • README setup notes

Example Output Explanation

# server.properties snippet
broker.id=1
listeners=PLAINTEXT://0.0.0.0:9092
advertised.listeners=PLAINTEXT://kafka.yourdomain.com:9092

log.dirs=/var/lib/kafka/data
num.partitions=3
default.replication.factor=3
offsets.topic.replication.factor=3
transaction.state.log.replication.factor=3

log.retention.hours=168
log.segment.bytes=1073741824

Security Notes

  • Do not put real passwords/secrets in generated configs. Use placeholders for JAAS configurations, SASL passwords, or SSL keystore passwords.
  • Restrict broker exposure. Never expose the broker port (9092) to the public internet without implementing robust SASL/SSL authentication.
  • Review advertised.listeners carefully. Misconfiguring this property is the #1 cause of clients failing to send or receive messages from a remote cluster.
  • Enable Encryption in Transit. Configure the broker to use SSL/TLS listeners for any data crossing untrusted network boundaries.

Frequently Asked Questions

What is a Kafka Config Generator?
A Kafka Config Generator is a tool used to generate the server.properties file for Apache Kafka brokers, as well as configuration properties for topics, producers, and consumers. It ensures you have optimal settings for data retention, replication factors, and networking.
How do I create Kafka config file?
Configure your broker settings in the generator above, export the output, and save it to your server as server.properties. This file is passed to the Kafka startup script.
What is server.properties in Kafka?
The server.properties file is the primary configuration file for a Kafka broker. It defines the broker ID, log directories, network listeners, and cluster connection details (like ZooKeeper or KRaft controllers).
How do I configure Kafka topic?
You can configure a topic using the kafka-configs.sh CLI tool or set default topic configurations directly in the server.properties file (e.g., num.partitions, default.replication.factor, log.retention.hours).
What is kafka-configs.sh?
kafka-configs.sh is a command-line utility provided by Apache Kafka used to dynamically alter configuration at the cluster, broker, or topic level without restarting the brokers.
How do I configure Kafka in Java?
In Java, you load producer or consumer properties into a java.util.Properties object and pass it to the KafkaProducer or KafkaConsumer constructor.
How do I configure Kafka in Spring Boot YAML?
Spring Boot auto-configures Kafka using properties defined in your application.yml under the spring.kafka prefix (e.g., spring.kafka.bootstrap-servers, spring.kafka.consumer.group-id).
What is Kafka advertised.listeners?
advertised.listeners is the address the broker broadcasts to clients telling them how to connect. If a client connects from outside a Docker network or VPC, this must resolve to the public or external IP/hostname of the broker.

How We Keep Your Configs Safe & Valid

Built-in Error Checking

Every file is checked against official rules. We catch missing fields and bad syntax. YAML indentation errors are flagged right away. Kubernetes, Terraform, and Docker specs are all covered. API versions and labels are verified too. You get valid output every time you generate.

100% Private & Local

All tools run in your browser only. Your API keys never leave your machine. We do not use any tracking scripts. No data is sent to any server. Passwords and secrets stay on your device. Crypto operations use the Web Crypto API. Your privacy is fully protected at all times.

Secure Settings by Default

Configs use safe defaults out of the box. Containers run as non-root users. Root filesystems are set to read-only. Dangerous Linux capabilities are dropped. Network policies limit pod-to-pod traffic. TLS 1.3 is enabled for web servers. Security headers are added where needed.

Ready for CI/CD & Git

Output files are ready for your Git repo. Use them with ArgoCD, Flux, or GitHub Actions. Files use clear formatting and comments. Code review is easy for your team. Indentation and key order are consistent. Test in staging before going to production. Every file is clean and well-structured.

Infrastructure as Code

Store configs in Git alongside your code. Terraform modules include typed variables. Backend configs support remote state locking. Outputs work across multiple modules. Ansible playbooks use clear task steps. Chef and Puppet configs are also supported. Every file works with version control tools.

Monitoring & Tracing

Set up Prometheus with auto-discovery rules. Create Grafana dashboards with template variables. Add alerting rules with severity labels. Use OpenTelemetry for trace collection. Forward logs to Loki or Elasticsearch. Connect to Jaeger or Tempo for tracing. Monitor metrics, logs, and traces together.

Container & Docker Safety

Dockerfiles use multi-stage builds for small images. Base images are pinned to exact versions. Dev files are excluded from final images. Health checks are added for orchestrator use. Containers switch to non-root users. Docker Compose uses named volumes and networks. Resource limits are set in deploy configs.

Multiple Output Formats

Export as YAML, JSON, HCL, or TOML. Kubernetes uses YAML with proper separators. Terraform uses HCL with correct escaping. JSON output has consistent indentation. Copy to clipboard with one click. Preview output with syntax highlighting. Line numbers help you review quickly.