Skip to content

Commit 69bc4e8

Browse files
authored
Merge pull request #16 from fgrosse/fix-consume-raw-output
Fix bug in kafkactl consume when --output is set to "raw"
2 parents 5566e80 + b7322de commit 69bc4e8

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
- Fix `kafkactl consume` when outputing raw messages
89
- Fix bug in `kafkactl get topics` that caused wrong partition IDs in JSON output
910
- Add `--with-config` flag to `kafkactl create topic`
1011

cmd/consume/consume.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ func (cmd *command) consume(ctx context.Context, topic string, partitions []int,
119119
for msg := range messages {
120120
if outputEncoding == "raw" {
121121
_, err := os.Stdout.Write(msg.Value)
122-
return err
122+
if err != nil {
123+
return err
124+
}
125+
continue
123126
}
124127

125128
decoded, err := dec.Decode(msg)

0 commit comments

Comments
 (0)