Skip to content

Commit

Permalink
add kafka connection properties to profile
Browse files Browse the repository at this point in the history
  • Loading branch information
emef committed Nov 22, 2024
1 parent a9ac8f7 commit c9b7383
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/arroyo-connectors/src/confluent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ impl From<ConfluentProfile> for KafkaConfig {
password: c.secret,
},
schema_registry_enum: Some(c.schema_registry.into()),
connection_properties: vec![],
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions crates/arroyo-connectors/src/kafka/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ impl KafkaConnector {
authentication: auth,
bootstrap_servers: BootstrapServers(pull_opt("bootstrap_servers", options)?),
schema_registry_enum: schema_registry,
connection_properties: vec![],
})
}

Expand Down Expand Up @@ -926,6 +927,14 @@ pub fn client_configs(
}
};

for prop in connection.connection_properties.iter() {
if let Some((k, v)) = prop.split_once('=') {
client_configs.insert(k.to_string(), v.to_string());
} else {
bail!("invalid connection property: {}", prop);
}
}

if let Some(table) = table {
client_configs.extend(
table
Expand Down
10 changes: 10 additions & 0 deletions crates/arroyo-connectors/src/kafka/profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@
"sensitive": ["apiSecret"]
}
]
},
"connectionProperties": {
"type": "array",
"title": "Connection Properties",
"description": "Key-value pairs of rdkafka configuration options",
"examples": ["client.id=arroyo"],
"items": {
"type": "string",
"title": "property"
}
}
},
"required": ["bootstrapServers", "authentication"]
Expand Down

0 comments on commit c9b7383

Please sign in to comment.