{"id":22555314,"url":"https://github.com/tomfun/kafka-test","last_synced_at":"2026-07-08T13:31:12.505Z","repository":{"id":260547953,"uuid":"878969562","full_name":"tomfun/kafka-test","owner":"tomfun","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-31T23:24:33.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T22:48:47.746Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomfun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-26T15:55:34.000Z","updated_at":"2024-10-31T23:24:37.000Z","dependencies_parsed_at":"2024-11-01T00:21:53.238Z","dependency_job_id":"5c78e3fa-054e-4458-8f18-a1461edc548d","html_url":"https://github.com/tomfun/kafka-test","commit_stats":null,"previous_names":["tomfun/kafka-test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tomfun/kafka-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomfun%2Fkafka-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomfun%2Fkafka-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomfun%2Fkafka-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomfun%2Fkafka-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomfun","download_url":"https://codeload.github.com/tomfun/kafka-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomfun%2Fkafka-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281527386,"owners_count":26516845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-07T19:07:27.992Z","updated_at":"2025-10-28T22:48:48.323Z","avatar_url":"https://github.com/tomfun.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kafka Docker Setup with Dynamic Rebalancing\n\nThis project sets up a minimal **Apache Kafka** environment using **Docker Compose** for testing consumer and producer scaling with automatic rebalancing. The setup includes **Kafka**, **Zookeeper**, multiple **producers** and **consumers**, and customized configurations to observe Kafka’s behavior under constrained resources.\n\n## Purpose\n\n1. **Deploy Kafka in a lightweight, resource-limited environment**: Testing Kafka's performance on minimal resources to observe CPU and memory usage under load.\n2. **Dynamically scale consumers and producers**: Adding and removing consumers/producers to trigger rebalances, allowing us to evaluate Kafka’s group coordination and rebalancing.\n3. **Monitor consumer group rebalancing**: Understanding the impact of partition configurations and consumer group properties on rebalancing behavior.\n\n## How It Works\n\n- **Kafka and Zookeeper**: Zookeeper coordinates broker metadata and partition assignments. Kafka brokers manage topics, partitions, and handle producer/consumer data flow.\n- **Consumers and Producers in Groups**: Consumers are assigned to a group (`test-consumer-group`) to enable load balancing. We add and remove consumers dynamically to simulate scaling.\n- **Forced Rebalancing**: To ensure even distribution of partitions, consumers are restarted periodically or stopped and replaced, triggering rebalancing through Kafka's Group Coordinator.\n- **Partition Adjustments**: Partition counts are adjusted dynamically to match the number of consumers, enabling each consumer to handle separate data streams.\n\n## Key Commands\n\n- **Start Consumers/Producers**: Run `add_consumer` or `add_producer` to add more consumers or producers.\n- **Manual Rebalance**: Stop all consumers and restart them to force a rebalance, or alter the partition count to trigger redistribution.\n\nThis setup provides a controlled environment to analyze Kafka’s rebalancing and performance under resource constraints.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomfun%2Fkafka-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomfun%2Fkafka-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomfun%2Fkafka-test/lists"}