Skip to content

Commit

Permalink
feat: allow creating topic with partitions using KAFKA_CREATE_TOPIC_P…
Browse files Browse the repository at this point in the history
…ARTITIONS
  • Loading branch information
gk-kindred committed Oct 1, 2024
1 parent ed1ffcc commit c55a354
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/talos_certifier_adapters/src/kafka/kafka_deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use rdkafka::{
error::KafkaError,
types::RDKafkaErrorCode,
};
use talos_common_utils::env_var_with_defaults;
use talos_rdkafka_utils::kafka_config::KafkaConfig;
use thiserror::Error as ThisError;

Expand Down Expand Up @@ -40,7 +41,7 @@ pub async fn create_topic() -> Result<KafkaDeployStatus, KafkaDeployError> {
println!("Topic does not exist, creating...");
let topic = NewTopic {
name: &kafka_certification_topic,
num_partitions: 1,
num_partitions: env_var_with_defaults!("KAFKA_CREATE_TOPIC_PARTITIONS", i32, 1),
replication: TopicReplication::Fixed(1),
config: vec![("message.timestamp.type", "LogAppendTime")],
};
Expand Down

0 comments on commit c55a354

Please sign in to comment.