Normalize Kafka configuration units to bytes#5530
Open
dorbae wants to merge 2 commits intoapache:masterfrom
Open
Normalize Kafka configuration units to bytes#5530dorbae wants to merge 2 commits intoapache:masterfrom
dorbae wants to merge 2 commits intoapache:masterfrom
Conversation
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.
Normalize Kafka configuration units to bytes for message and request size parameters.
Description
Kafka configuration units related to size are in bytes. However, ByteSize supports various units. I believe it's better to normalize the unit to bytes to help reduce human errors.
For example, if max-message-bytes is set with an MB unit, the topic configuration could mistakenly interpret it as 3 bytes instead of 3 MB:
Currently, several topics set max.message.bytes as
${whisk.activation.kafka.payload.max} + ${whisk.activation.kafka.serdes-overhead}. Fortunately, this ensures the unit remains in bytes when summing the two values.Despite this, I believe normalizing the unit to bytes will help prevent unexpected bugs.
Related issue and scope
My changes affect the following components
Types of changes
Checklist: