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

Update kafka config to have isSecure option #5473

Merged
merged 3 commits into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions common/config/kafkaConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ type (
// TopicConfig describes the mapping from topic to Kafka cluster
TopicConfig struct {
Cluster string `yaml:"cluster"`
// IsSecure describes whether the topic is secure, by default it is false
// If it is set to true, it allows to pass in the token to initialize secure producer for this topic
IsSecure bool `yaml:"isSecure,omitempty"`
}

// TopicList describes the topic names for each cluster
Expand Down Expand Up @@ -99,3 +102,8 @@ func (k *KafkaConfig) GetBrokersForKafkaCluster(kafkaCluster string) []string {
func (k *KafkaConfig) GetTopicsForApplication(app string) TopicList {
return k.Applications[app]
}

// GetKafkaClusterSecureConfigForTopic gets isSecure status from topic
func (k *KafkaConfig) GetKafkaSecureConfigForTopic(topic string) bool {
return k.Topics[topic].IsSecure
neil-xie marked this conversation as resolved.
Show resolved Hide resolved
}