Skip to content

Commit

Permalink
Fixed producing value as key in case an avro schema registry is confi…
Browse files Browse the repository at this point in the history
…gured
  • Loading branch information
d-rk committed May 27, 2019
1 parent 986ed4c commit 2d6d2ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Fixed producing value as key in case an avro schema registry is configured.

## 1.2.0 - 2019-05-24

### Added
Expand Down
2 changes: 1 addition & 1 deletion operations/producer/AvroMessageSerializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (serializer AvroMessageSerializer) Serialize(key, value []byte, flags Produ
message := &sarama.ProducerMessage{Topic: serializer.topic, Partition: flags.Partition}

if key != nil {
message.Key = sarama.ByteEncoder(serializer.encode(value, flags.KeySchemaVersion, "key"))
message.Key = sarama.ByteEncoder(serializer.encode(key, flags.KeySchemaVersion, "key"))
}

message.Value = sarama.ByteEncoder(serializer.encode(value, flags.ValueSchemaVersion, "value"))
Expand Down

0 comments on commit 2d6d2ce

Please sign in to comment.