{"id":22327749,"url":"https://github.com/manadaym/kafka-101","last_synced_at":"2025-09-08T04:32:48.959Z","repository":{"id":211321820,"uuid":"728744609","full_name":"ManadayM/kafka-101","owner":"ManadayM","description":"A simple Kafka implementation to understand Kafka's core components - Producer, Consumer, Consumer Groups, etc.","archived":false,"fork":false,"pushed_at":"2023-12-07T19:15:11.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T06:28:38.818Z","etag":null,"topics":["kafka"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ManadayM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-12-07T15:46:07.000Z","updated_at":"2023-12-22T02:00:19.000Z","dependencies_parsed_at":"2023-12-07T20:26:16.552Z","dependency_job_id":"ac88deea-32b4-48b7-a367-45fc4ae249d7","html_url":"https://github.com/ManadayM/kafka-101","commit_stats":null,"previous_names":["manadaym/kafka-101"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ManadayM/kafka-101","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManadayM%2Fkafka-101","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManadayM%2Fkafka-101/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManadayM%2Fkafka-101/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManadayM%2Fkafka-101/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ManadayM","download_url":"https://codeload.github.com/ManadayM/kafka-101/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManadayM%2Fkafka-101/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274134715,"owners_count":25228198,"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-09-08T02:00:09.813Z","response_time":121,"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":["kafka"],"created_at":"2024-12-04T03:10:28.935Z","updated_at":"2025-09-08T04:32:48.919Z","avatar_url":"https://github.com/ManadayM.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kafka 101\n\n## Prerequisite\n\n- Node.js\n- Docker\n- VS Code\n\n## Setup\n\n- Start Zookeeper Container\n\n```bash\ndocker run -p 2181:2181 zookeeper\n```\n\n- Start Kafka Container using the following command. Replace `\u003cPRIVATE_IP\u003e` with your IP address.\n\n```bash\ndocker run -p 9092:9092 \\\n-e KAFKA_ZOOKEEPER_CONNECT=\u003cPRIVATE_IP\u003e:2181 \\\n-e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://\u003cPRIVATE_IP\u003e:9092 \\\n-e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 \\\nconfluentinc/cp-kafka\n```\n\n## Run the app\n\n### Admin (`admin.js`)\nKafka admin setups `Topic` and `Partitions`. Run the following command to setup Kafka topic.\n\n```shell\nnode admin.js\n```\n\n### Consumer (`consumer.js`)\n\nKafka `Consumer` subscribes to a `Topic`.\n\n```bash\n# Here, \"user-1\" is a group id of Kafka Consumer Group.\nnode consumer.js user-1\n```\n\nExecuting this command in 2 terminal windows will register 2 consumers on the `user-1` consumer group. As we have 2 partitions configured, each consumer will have access to one partition only.\n\n```bash\nnode consumer.js user-2\n```\n\nExecuting this command in a terminal window will register a single consumer on the `user-2` consuer group. However, this time consumer will have access to events from both the partitions as there's only one consumer against 2 partitions.\n\n### Producer (`producer.js`)\n\nRunning the following command will show a newline prompt.\n\n```bash\nnode producer.js \n```\n\nEnter the following sample input and observe the events being logged on the consumer's side (consumer's terminal window).\n\n```bash\n\u003e tony north\n\u003e johny south\n\u003e andrew north\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanadaym%2Fkafka-101","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanadaym%2Fkafka-101","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanadaym%2Fkafka-101/lists"}