booblik-conformance
Generated page
Model gemma-mtp, commit ef58254ca7be, 2026-08-16, sources: 2. Edit the code or the hand-written documentation instead.
Diagram
The conformance client contract
This module serves as the reference implementation of the conformance client contract, acting as a fixture for the harness to ensure the protocol is correctly implemented Main.kt:14-19. It is designed to prove that the harness works by providing a "green" baseline where every check in the harness passes before any other client is tested Main.kt:18-19.
More: The conformance client contract
Command-line verbs
The operational modes available via the command line are:
| Verb | Description |
|---|---|
metadata | Retrieves topic metadata including partition offsets Main.kt:60 |
produce | Produces a list of records to a specific partition Main.kt:64 |
produce-keyed | Partitions a payload based on a key using Fnv1a before producing Main.kt:68 |
fetch | Fetches records from a partition up to a specific byte limit Main.kt:72 |
More: Command-line verbs
Produce and AckPolicy
The interaction between produce requests and the response lifecycle is governed by the AckPolicy Main.kt:116-121:
| AckPolicy | Behavior |
|---|---|
none | No response is expected; the client returns immediately Main.kt:124-126 |
written | Client waits for and reads the produce response Main.kt:160 |
forced | Client waits for and reads the produce response Main.kt:160 |
Partitioner.Fnv1a
For keyed production, the client uses Partitioner.Fnv1a to select a partition Main.kt:158. This selection is made by mapping the key against the list of partitions obtained from the broker's metadata Main.kt:154-157.
Fetch truncation and maxBytes
When performing a fetch, the client handles cases where the response might be incomplete Main.kt:182. If the records list is empty but the truncated flag is set, it indicates that the next record in the log is larger than the maxBytes requested, resulting in a recordExceedsMaxBytes report Main.kt:182-184.
Key files
| File | Lines | What is there |
|---|---|---|
booblik-conformance/build.gradle.kts | 18-20 | Dependency declaration for :booblik-client |
…/conformance/Main.kt | 37-88 | Main entry point and command-line argument parsing |
…/conformance/Main.kt | 90-106 | Metadata retrieval logic |
…/conformance/Main.kt | 108-132 | Standard produce logic |
…/conformance/Main.kt | 143-166 | Keyed produce logic using Fnv1a |
…/conformance/Main.kt | 168-189 | Fetch logic and truncation handling |
Behaviour that surprises
- When using
AckPolicy.NONE, theBooblikClient.sendProducefunction returnsnull, and the client must return immediately without reading to avoid blocking foreverMain.kt:124-126. - A
fetchresponse that contains an empty list of records but has thetruncatedflag set is not a sign of having caught up to the head, but rather an indication that the next record exceedsmaxBytesMain.kt:182-184.