I'm trying to create a topic (an Event Hub) programmatically from the Kafka interface using AdminClient.CreateTopicsAsync. This works when connecting to Kafka, but not to Event Hub. I'm running into the following error:
Default partition count (KIP-464) not supported by broker, requires broker version <= 2.4.0
using Confluent.Kafka;
using Confluent.Kafka.Admin;
var adminClient =
new AdminClientBuilder(
new[] {
("sasl.mechanism","PLAIN"),
("security.protocol","SASL_SSL"),
("bootstrap.servers", Address),
("sasl.username", "$ConnectionString"),
("sasl.password", ConnectionString),
}.Select((kvp) => new KeyValuePair<string, string>(kvp.Item1, kvp.Item2))
)
.Build();
await adminClient.CreateTopicsAsync(new[] {
new TopicSpecification {
Name = "test-topic"
}
});
It complains that using a default number of partitions is not supported, but as far as I can tell, I can't provide one as the underlying librdkafka does not support it. The only information I could find by googling this is that someone in 2021 did make it work.