Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .docs/server-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ Skip SSL verification of kafka server certificate.

Kafka authorization as JSON object `{"mechanism": "SCRAM-SHA-256|PLAIN", "username": "user", "password": "password"}`

### `BULKER_KAFKA_SECURITY_PROTOCOL`

Allows setting Kafka `security.protocol`


## Batching

Expand Down
7 changes: 6 additions & 1 deletion kafkabase/kafka_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type KafkaConfig struct {
KafkaSSLSkipVerify bool `mapstructure:"KAFKA_SSL_SKIP_VERIFY" default:"false"`
KafkaSSLCA string `mapstructure:"KAFKA_SSL_CA"`
KafkaSSLCAFile string `mapstructure:"KAFKA_SSL_CA_FILE"`
KafkaSecurityProtocol string `mapstructure:"KAFKA_SECURITY_PROTOCOL"`

// Kafka authorization as JSON object {"mechanism": "SCRAM-SHA-256|PLAIN", "username": "user", "password": "password"}
KafkaSASL string `mapstructure:"KAFKA_SASL"`
Expand Down Expand Up @@ -48,7 +49,7 @@ type KafkaConfig struct {
ProducerBatchSize int `mapstructure:"PRODUCER_BATCH_SIZE" default:"65535"`
ProducerLingerMs int `mapstructure:"PRODUCER_LINGER_MS" default:"1000"`
ProducerWaitForDeliveryMs int `mapstructure:"PRODUCER_WAIT_FOR_DELIVERY_MS" default:"1000"`

// Failover logger configuration
FailoverLoggerEnvConfig `mapstructure:",squash"`
}
Expand Down Expand Up @@ -91,6 +92,10 @@ func (ac *KafkaConfig) GetKafkaConfig() *kafka.ConfigMap {
}
}

if ac.KafkaSecurityProtocol != "" {
_ = kafkaConfig.SetKey("security.protocol", ac.KafkaSecurityProtocol)
}

return kafkaConfig
}

Expand Down