booblik
Wiki

booblik-native-conformance

Generated page

Model gemma-mtp, commit ef58254ca7be, 2026-08-16, sources: 3. Edit the code or the hand-written documentation instead.

Diagram

The conformance executable

The booblik-native-conformance module serves as a test harness for the Kotlin/Native client, designed to verify the protocol implementation against a real broker. As specified in build.gradle.kts:18-32, the module defines two distinct Kotlin/Native binaries: a conformance executable and a probe executable, both targeting linuxX64 and macosArm64.

More: The conformance executable

The conformance verb interface

The conformance executable provides a command-line interface to exercise specific protocol operations. According to Main.kt:47-68, the available verbs are:

VerbDescription
metadataRetrieves topic metadata, including partition offsets (Main.kt:73-86).
produceSends records to a specific partition with a chosen AckPolicy (Main.kt:89-115).
produce-keyedUses a partitioner to select a partition based on a key before producing (Main.kt:121-135).
fetchRetrieves records from a partition at a specific offset (Main.kt:143-164).

More: The conformance verb interface

The probe performance measurement

The probe executable is used to measure the throughput of the native client under different concurrency models. As implemented in Probe.kt:65-75, the benchmark compares throughput (records per second) across different numbers of callers (1, 8, and 64) to determine the efficiency of the accumulator.

More: The probe performance measurement

The DIRECT mode

In DIRECT mode, the system operates without an accumulator. As described in Probe.kt:79-80, each caller uses its own BooblikConnection and sends every record as its own request, awaiting the response before proceeding.

The BATCHED mode

The BATCHED mode utilizes an accumulator to group multiple records into a single request. According to Probe.kt:82-83, all callers share a single connection and a single accumulator, but they still await the result of each send operation before moving to the next record.

The BATCHED_NOT_AWAITED mode

This mode implements a pipelined approach to batching. As detailed in Probe.kt:85-87, multiple records are queued via producer.send without being immediately awaited, allowing the accumulator to build larger batches by overlapping requests.

Key files

FileLinesWhat is there
booblik-native-conformance/build.gradle.kts18-32Configuration of Kotlin/Native targets and binary entry points.
…/conformance/Main.kt47-68The main command-line dispatch logic for the conformance client.
…/conformance/Probe.kt79-87Definition of the different benchmarking modes.

Behaviour that surprise

  • The conformance executable's main function is designed to return exit code 0 even if the broker refuses a request, provided the refusal is a valid protocol result (Main.kt:19-20).
  • In BATCHED_NOT_AWAITED mode, the producer.send calls are collected into a list and then awaitAll is called, which allows the lingerMillis window to fill by having more than one record in flight (Probe.kt:140-145).
  • The verify function in the probe ensures that no two records are assigned the same Offset and that the total count of returned offsets matches the expected number of sent records (Probe.kt:174-185).

On this page