Reputation: 685
I have installed Kafka on my development windows machine (kafka_2.11-2.4.0.tgz). It all works fine and I'm able to send and receive messages using the sample batch scripts.
Trying to build a C# windows application, I'm using Confluent's .NET Client for Apache Kafka (version 1.3.0.0) on a C# windows application. However when I'm using the sample given by Confluent to list the group subscriptions I'm getting the error System.ArgumentNullException: 'Argument 'group' must not be null. Parameter name: group'
but there is no such argument that I pass into the method. Here's the code sample:
private static string ListConsumerGroups(string bootstrapServers) {
string s = ($"Consumer Groups:");
using (var adminClient = new AdminClientBuilder(new AdminClientConfig { BootstrapServers = bootstrapServers }).Build()) {
var groups = adminClient.ListGroups(TimeSpan.FromSeconds(10));
foreach (var g in groups) {
s += "\r\n" + ($" Group: {g.Group} {g.Error} {g.State}");
s += "\r\n" + ($" Broker: {g.Broker.BrokerId} {g.Broker.Host}:{g.Broker.Port}");
s += "\r\n" + ($" Protocol: {g.ProtocolType} {g.Protocol}");
s += "\r\n" + ($" Members:");
foreach (var m in g.Members) {
s += "\r\n" + ($" {m.MemberId} {m.ClientId} {m.ClientHost}");
s += "\r\n" + ($" Metadata: {m.MemberMetadata.Length} bytes");
s += "\r\n" + ($" Assignment: {m.MemberAssignment.Length} bytes");
}
}
}
return s;
}
The code fails when making the call to adminClient.ListGroups
with the timespan argument (no other arguments allowed into this method). I dont understand whether there is a bug in the API or I'm just missing something.
When using the batch scripts to list the consumer group I do get a valid answer back.
> kafka-consumer-groups.bat --list --bootstrap-server "localhost:9092"
Upvotes: 2
Views: 2096
Reputation: 491
this was a regression introduced in v1.3.0. It's resolved in v1.4.0-RC1 and later.
Upvotes: 3