XrcDPNG66HtreJDo

GraalVM Based Native Apache Kafka Docker Image

Introduction

Native-Image reachability metadata

The native-image tool performs static analysis while building a native binary to determine the dynamic features(the dynamic language features of the JVM, including reflection and resource handling, compute the dynamically-accessed program elements such as invoked methods or resource URLs at runtime), but it cannot always exhaustively predict all uses. To ensure inclusion of these elements into the native binary, reachability metadata should be provided to the native-image builder. These metadata configs are provided in the native-image-configs directory.

How to generate reachability metadata

GraalVM provide an option to create these configs automatically by running the application normally with the native-image agent attached. The configs in the native-image-configs directory are generated by running existing Apache Kafka System Tests(using GraalVM JIT and attaching the native-image agent to the process) as they are quite exhaustive.

To update reachability metadata, users can set following environment variable and run related jar files. New metadata configs will be generated in the native-image-configs directory.

export JAVA_TOOL_OPTIONS="-agentlib:native-image-agent=config-merge-dir=/path/to/kafka/docker/native/native-image-configs"

Limitations of Native Apache Kafka executable

How to use this image in docker container

Check out this guide.

How to build, test and release this docker image

Check out this guide.

How to run system tests on native Apache Kafka

Check out this guide.