docs(examples): add KPipe.bytes example (refs #166)#183
Merged
Conversation
Adds an `examples/bytes` module that demonstrates the `KPipe.bytes(topic, props)` fluent entry point — the only bundled format without an example before this change (audit finding from issue #166). The example wires a `MessageSink<byte[]>` that logs each record's length plus a short hex preview. Useful as a reference for raw proxying, archival, or pre-format inspection where the pipeline stays in `byte[]` end-to-end with no SerDe.
Owner
Author
|
@copilot please review |
Copilot stopped work on behalf of
eschizoid due to an error
June 18, 2026 17:28
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #183 +/- ##
=========================================
Coverage 77.08% 77.08%
Complexity 752 752
=========================================
Files 72 72
Lines 2858 2858
Branches 355 355
=========================================
Hits 2203 2203
Misses 489 489
Partials 166 166 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The audit in #166 flagged that
KPipe.bytes(topic, props)was the only bundled format on the fluent facade without a correspondingexamples/module. JSON, Avro, Protobuf, and the multi/demo paths all had complete reference apps; the raw-bytes path did not.This PR adds
examples/bytesto close that gap.What the example teaches
KPipe.bytes(topic, props).toCustom(MessageSink<byte[]>).start()— the simplest possible end-to-end raw-bytes consumer.byte[]end-to-end with no format SerDe — useful for proxying, raw archival, or pre-format inspection where the consumer doesn't care about the payload structure.MessageSink<byte[]>logs each record's length plus a short hex preview, mirroring whatbytesConsoleSink()does internally but inlined so the reader can see howtoCustom(...)plugs in.Structure
Copied from
examples/json/:examples/bytes/build.gradle.kts— same shape as the json module, minus the JSON format dep (rawbyte[]needs no format module —MessageFormat.bytes()lives inkpipe-core, transitively pulled bykpipe-api).examples/bytes/src/main/java/io/github/eschizoid/kpipe/App.java—AppConfig.fromEnv()+KafkaConsumerConfig+ a 5-lineMessageSink<byte[]>lambda.settings.gradle.kts— registersexamples:bytes.Refs #166 (does not close — that issue tracks broader audit follow-ups).