Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set kafka message size and compression as configurable #173

Conversation

leonlnj
Copy link
Contributor

@leonlnj leonlnj commented Mar 3, 2022

Overview

This MR is a follow up from the previous, it allows
max.request.size and compression.type of the Kafka producer configuration to be set in helm values when deploying Turing Server.

Modification

api/turing/api/request/request.go - Appended MaxMessageBytes and CompressionType during building of new router version when logger type is kafka.
api/turing/cluster/servicebuilder/router.go - Creating router with env var APP_KAFKA_MAX_MESSAGE_BYTES and APP_KAFKA_COMPRESSION_TYPE
engines/router/missionctl/log/resultlog/kafka.go - Router's logger to init with config, which are read from env var during initialisation.

Testing

Setting router default in Turing Server helms value
image

Router container env var set with the global values
image

@leonlnj leonlnj requested a review from a team March 7, 2022 01:40
@leonlnj leonlnj self-assigned this Mar 7, 2022
@leonlnj leonlnj marked this pull request as ready for review March 7, 2022 02:26
Copy link
Collaborator

@terryyylim terryyylim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes @leonlnj !

api/turing/config/config.go Show resolved Hide resolved
@leonlnj leonlnj merged commit a3d788d into caraml-dev:main Mar 7, 2022
@@ -52,6 +52,10 @@ type KafkaConfig struct {
Topic string `json:"topic"`
// Serialization Format used for the messages
SerializationFormat SerializationFormat `json:"serialization_format"`
// Producer Config - Max message byte to send to broker
MaxMessageBytes int `json:"max_message_bytes"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, these values can just be applied at deploy time, like many other default values we have in RouterDefaults (since they are currently applicable to all routers and not user-configured). Any reason we are saving this to the DB?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants