forked from provectus/kafka-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement deserializing binary protobuf encoded message keys (provect…
…us#1729) * Add protobufMessageNameForKeyByTopic option to config. Message keys are deserialized using a protobuf schema if the config is set. Otherwise message keys are treated as strings. Closes provectus#1699 * Add documentation around kafkaui's protobuf support * Add protobufMessageNameForKey config option * Update README with info about default types * Imeplement support for protobufMessageNameForKeyByTopic * fallback to FALLBACK_FORMATTER * Add ability to publish message with protobuf key * Change log levels to debug and add @nullable annotations * Attempt at fixing documentation workflow Co-authored-by: Ilya Kuramshin <ilia-2k@rambler.ru> Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com> Co-authored-by: Roman Zabaluev <github@haarolean.dev>
- Loading branch information
1 parent
4fabb09
commit e8999cf
Showing
7 changed files
with
179 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Kafkaui Protobuf Support | ||
|
||
Kafkaui supports deserializing protobuf messages in two ways: | ||
1. Using Confluent Schema Registry's [protobuf support](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/serdes-protobuf.html). | ||
2. Supplying a protobuf file as well as a configuration that maps topic names to protobuf types. | ||
|
||
## Configuring Kafkaui with a Protobuf File | ||
|
||
To configure Kafkaui to deserialize protobuf messages using a supplied protobuf schema add the following to the config: | ||
```yaml | ||
kafka: | ||
clusters: | ||
- # Cluster configuration omitted. | ||
# protobufFile is the path to the protobuf schema. | ||
protobufFile: path/to/my.proto | ||
# protobufMessageName is the default protobuf type that is used to deserilize | ||
# the message's value if the topic is not found in protobufMessageNameByTopic. | ||
protobufMessageName: my.Type1 | ||
# protobufMessageNameByTopic is a mapping of topic names to protobuf types. | ||
# This mapping is required and is used to deserialize the Kafka message's value. | ||
protobufMessageNameByTopic: | ||
topic1: my.Type1 | ||
topic2: my.Type2 | ||
# protobufMessageNameForKey is the default protobuf type that is used to deserilize | ||
# the message's key if the topic is not found in protobufMessageNameForKeyByTopic. | ||
protobufMessageNameForKey: my.Type1 | ||
# protobufMessageNameForKeyByTopic is a mapping of topic names to protobuf types. | ||
# This mapping is optional and is used to deserialize the Kafka message's key. | ||
# If a protobuf type is not found for a topic's key, the key is deserialized as a string, | ||
# unless protobufMessageNameForKey is specified. | ||
protobufMessageNameForKeyByTopic: | ||
topic1: my.KeyType1 | ||
``` |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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