microsoft / CSharpClient-for-Kafka

.Net implementation of the Apache Kafka Protocol that provides basic functionality through Producer/Consumer classes. The project also offers balanced consumer implementation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Balanced Consumer Usage throw TimeoutException

sinjimmyi opened this issue · comments

I try to set up balanced consumer with the following code.
ConsumerConfiguration consumer = new ConsumerConfiguration() { AutoCommit = false, GroupId = "testgroupid", ConsumerId="testconsumerid", ZooKeeper = new ZooKeeperConfiguration("192.168.198.3:2181", 0, 6000, 2000) }; ZookeeperConsumerConnector zoo = new ZookeeperConsumerConnector(consumer, true); IDictionary<string, int> topicMap = new Dictionary<string, int> { { "paidorder", 1 } }; var streams = zoo.CreateMessageStreams(topicMap, new DefaultDecoder()); var KafkaMessageStream = streams["paidorder"][0];

But it throws timeoutexception, is this happend in anyone else?
[TimeoutException: The request �/consumers/testgroupid/ids� timed out while waiting for a response from the server.] ZooKeeperNet.ClientConnection.SubmitRequest(RequestHeader h, IRecord request, IRecord response, WatchRegistration watchRegistration) +200 ZooKeeperNet.ZooKeeper.Exists(String path, IWatcher watcher) +177 ZooKeeperNet.ZooKeeper.Exists(String path, Boolean watch) +48 Kafka.Client.ZooKeeperIntegration.ZooKeeperConnection.Exists(String path, Boolean watch) in C:\Users\yidepiao\Documents\CSharpClient-for-Kafka\src\KafkaNET.Library\ZooKeeperIntegration\ZooKeeperConnection.cs:187 Kafka.Client.ZooKeeperIntegration.<>c__DisplayClass30_0.<Exists>b__0() in C:\Users\yidepiao\Documents\CSharpClient-for-Kafka\src\KafkaNET.Library\ZooKeeperIntegration\ZooKeeperClient.cs:461 Kafka.Client.ZooKeeperIntegration.ZooKeeperClient.RetryUntilConnected(Func1 callback) in C:\Users\yidepiao\Documents\CSharpClient-for-Kafka\src\KafkaNET.Library\ZooKeeperIntegration\ZooKeeperClient.cs:327
Kafka.Client.ZooKeeperIntegration.ZooKeeperClient.Exists(String path, Boolean watch) in C:\Users\yidepiao\Documents\CSharpClient-for-Kafka\src\KafkaNET.Library\ZooKeeperIntegration\ZooKeeperClient.cs:460
Kafka.Client.ZooKeeperIntegration.ZooKeeperClient.Exists(String path) in C:\Users\yidepiao\Documents\CSharpClient-for-Kafka\src\KafkaNET.Library\ZooKeeperIntegration\ZooKeeperClient.cs:440
Kafka.Client.ZooKeeperIntegration.<>c__DisplayClass82_0.b__0() in C:\Users\yidepiao\Documents\CSharpClient-for-Kafka\src\KafkaNET.Library\ZooKeeperIntegration\ZooKeeperClient.Watcher.cs:373
Kafka.Client.ZooKeeperIntegration.ZooKeeperClient.RetryUntilConnected(Func1 callback) in C:\Users\yidepiao\Documents\CSharpClient-for-Kafka\src\KafkaNET.Library\ZooKeeperIntegration\ZooKeeperClient.cs:327 Kafka.Client.ZooKeeperIntegration.ZooKeeperClient.WatchForChilds(String path) in C:\Users\yidepiao\Documents\CSharpClient-for-Kafka\src\KafkaNET.Library\ZooKeeperIntegration\ZooKeeperClient.Watcher.cs:370 Kafka.Client.ZooKeeperIntegration.ZooKeeperClient.Subscribe(String path, IZooKeeperChildListener listener) in C:\Users\yidepiao\Documents\CSharpClient-for-Kafka\src\KafkaNET.Library\ZooKeeperIntegration\ZooKeeperClient.Watcher.cs:253 Kafka.Client.Consumers.ZookeeperConsumerConnector.Consume(IDictionary2 topicCountDict, IDecoder1 decoder) in C:\Users\yidepiao\Documents\CSharpClient-for-Kafka\src\KafkaNET.Library\Consumers\ZookeeperConsumerConnector.cs:618 Kafka.Client.Consumers.ZookeeperConsumerConnector.CreateMessageStreams(IDictionary2 topicCountDict, IDecoder1 decoder) in C:\Users\yidepiao\Documents\CSharpClient-for-Kafka\src\KafkaNET.Library\Consumers\ZookeeperConsumerConnector.cs:330