{"id":15013793,"url":"https://github.com/ozangunalp/kafka-native","last_synced_at":"2025-04-05T20:08:51.379Z","repository":{"id":64663240,"uuid":"546153288","full_name":"ozangunalp/kafka-native","owner":"ozangunalp","description":"Kafka broker compiled to native using Quarkus and GraalVM.","archived":false,"fork":false,"pushed_at":"2025-03-28T16:59:44.000Z","size":570,"stargazers_count":104,"open_issues_count":12,"forks_count":13,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-29T19:07:45.709Z","etag":null,"topics":["java","kafka","quarkus","test-containers","zookeeper"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ozangunalp.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-05T16:06:34.000Z","updated_at":"2025-03-20T09:44:32.000Z","dependencies_parsed_at":"2023-10-16T18:54:34.526Z","dependency_job_id":"d8c40bf6-ff6a-4060-ba15-60a8516bd82e","html_url":"https://github.com/ozangunalp/kafka-native","commit_stats":{"total_commits":201,"total_committers":7,"mean_commits":"28.714285714285715","dds":0.4129353233830846,"last_synced_commit":"ee69ff19268b1549004cb5c569105fc4828636b9"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozangunalp%2Fkafka-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozangunalp%2Fkafka-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozangunalp%2Fkafka-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozangunalp%2Fkafka-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ozangunalp","download_url":"https://codeload.github.com/ozangunalp/kafka-native/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393571,"owners_count":20931813,"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","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":["java","kafka","quarkus","test-containers","zookeeper"],"created_at":"2024-09-24T19:44:47.354Z","updated_at":"2025-04-05T20:08:51.372Z","avatar_url":"https://github.com/ozangunalp.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kafka Native\n\nKafka broker compiled to native using Quarkus and GraalVM.\n\n## Project Structure\n\n- `quarkus-kafka-server-extension`: Quarkus extension including for compiling Kafka Server to native using GraalVM.\n- `kafka-server`: Quarkus application starting a Kafka server using the kafka-server-extension. Compiles to JVM and native executable.\n- `kafka-native-test-container`: Test containers starting a single-node Kafka broker using the native-compiled kafka-server. Includes integration tests.\n\n## Building the project\n\n```shell script\nmvn install\n```\n\n## Running kafka in dev mode\n\nYou can run kafka in dev mode that enables live coding using:\n```shell script\ncd kafka-server\nmvn compile quarkus:dev\n```\n\nStarts a single-node Kafka broker listening on `PLAINTEXT://9092`. \nUses `./target/log-dir` as log directory.\n\n## Packaging and running the application\n\nThe application can be packaged using the following on either the `kafka-server` directory:\n```shell script\nmvn package\n```\nIt produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory.\nBe aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.\n\nThe application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`.\n\n## Creating native executables\n\nYou can create a native executable using the following either the `kafka-server` directory:\n```shell script\nmvn package -Pnative\n```\n\nOr, if you don't have GraalVM installed, you can run the native executable build in a container using:\n```shell script\nmvn package -Pnative -Dquarkus.native.container-build=true\n```\n\nYou can then execute your native executable with: `./target/kafka-server-1.0.0-SNAPSHOT-runner`\n\n## Creating a container from native executable\n\nYou can create a container from the native executable using: \n```shell script\nmvn package -Dnative -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true\n```\n\nThe container images will be built with tag `quay.io/ogunalp/kafka-native:1.0.0-SNAPSHOT`.\n\nIf you want to reuse the existing native executable:\n\n```shell script\nmvn package -Dnative -Dquarkus.native.reuse-existing=true -Dquarkus.container-image.build=true\n```\n\nIn case your container runtime is not running locally, use the parameter `-Dquarkus.native.remote-container-build=true` instead of `-Dquarkus.native.container-build=true`.\n\nThen you can run the docker image using:\n\n```shell script\ndocker run -p 19092:9092 -it --rm -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:19092 quay.io/ogunalp/kafka-native:1.0.0-SNAPSHOT\n```\n\n## Configuring the Kafka broker\n\nBy default, the `kafka-server` application configures an embedded Kafka Kraft server for a single node cluster.\n\nFollowing configuration options are available:\n\n| Key                           | Description                                                                               | Default            |\n|-------------------------------|-------------------------------------------------------------------------------------------|--------------------|\n| `server.kafka-port`           | External listener port                                                                    | 9092               |\n| `server.internal-port`        | Internal listener port                                                                    | 9093               |\n| `server.controller-port`      | Controller listener port                                                                  | 9094               |\n| `server.delete-dirs-on-close` | Whether to delete `log-dir` on application close                                          | false              |\n| `server.host`                 | Hostname of listeners                                                                     | `` (empty string)  |\n| `server.cluster-id`           | Provide `cluster-id`, generated if empty                                                  |                    |\n| `server.properties-file`      | Path to `server.properties` file                                                          |                    |\n| `server.auto-configure `      | Automatically configure server properties, if false only `server.properties` is respected | true               |\n| `kafka.log.dir`               | Path to `log-dir` directory, will create the directory if                                 | `./target/log-dir` |\n| `kafka.advertised.listeners`  | Override `advertised.listeners`                                                           |                    |\n| `kafka.*`                     | Override broker properties                                                                |                    |\n\n\nYou can set configuration options using Java system properties, e.g.\n\n```shell script\njava -Dserver.delete-dirs-on-close=true \\\n  -Dserver.properties-file=server.properties \\\n  -Dkafka.advertised.listeners=SSL://localhost:9092 -jar ./target/quarkus-app/quarkus-run.jar\n```\n\nOr environment variables, e.g.\n\n```shell script\ndocker run -it --rm -p 19092:9092 \\\n  -v $(pwd):/conf \\\n  -e SERVER_PROPERTIES_FILE=/conf/server.properties \\\n  -e KAFKA_ADVERTISED_LISTENERS=SASL_PLAINTEXT://localhost:19092 \\\n  quay.io/ogunalp/kafka-native:1.0.0-SNAPSHOT\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozangunalp%2Fkafka-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fozangunalp%2Fkafka-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozangunalp%2Fkafka-native/lists"}