confluent-kafka-dotnet
confluent-kafka-dotnet copied to clipboard
Consumer cannot properly connect to Broker while Producer can
Description
I set up a Kafka instance running Kafka 3.4 according to this tutorial: https://adityasridhar.com/posts/how-to-easily-install-kafka-without-zookeeper. When using the Kafka cli on the server, Producer and Consumer run fine. Beside of this, I wrote a very simple producer and consumer in c# using Confluent.Kafka 2.0.2 via nuget. The Producer works perfectly fine sending messages to the Kafka instance. When running the Comsumer I only get error messages.
%5|1678450877.456|REQTMOUT|rdkafka-9be0bc7c-cc0c-4de5-aa44-566aedc2352b#consumer-1| [thrd:172.25.16.200:9093/2]: 172.25.16.200:9093/2: Timed out ApiVersionRequest in flight (after 10107ms, timeout #0)
%4|1678450877.456|FAIL|rdkafka-9be0bc7c-cc0c-4de5-aa44-566aedc2352b#consumer-1| [thrd:172.25.16.200:9093/2]: 172.25.16.200:9093/2: ApiVersionRequest failed: Local: Timed out: probably due to broker version < 0.10 (see api.version.request configuration) (after 10108ms in state APIVERSION_QUERY)
%4|1678450877.456|REQTMOUT|rdkafka-9be0bc7c-cc0c-4de5-aa44-566aedc2352b#consumer-1| [thrd:172.25.16.200:9093/2]: 172.25.16.200:9093/2: Timed out 1 in-flight, 0 retry-queued, 0 out-queue, 0 partially-sent requests
%3|1678450877.457|ERROR|rdkafka-9be0bc7c-cc0c-4de5-aa44-566aedc2352b#consumer-1| [thrd:app]: rdkafka-9be0bc7c-cc0c-4de5-aa44-566aedc2352b#consumer-1: 172.25.16.200:9093/2: ApiVersionRequest failed: Local: Timed out: probably due to broker version < 0.10 (see api.version.request configuration) (after 10108ms in state APIVERSION_QUERY)
%5|1678450887.724|REQTMOUT|rdkafka-9be0bc7c-cc0c-4de5-aa44-566aedc2352b#consumer-1| [thrd:172.25.16.200:9093/2]: 172.25.16.200:9093/2: Timed out ApiVersionRequest in flight (after 10081ms, timeout #0)
%4|1678450887.724|FAIL|rdkafka-9be0bc7c-cc0c-4de5-aa44-566aedc2352b#consumer-1| [thrd:172.25.16.200:9093/2]: 172.25.16.200:9093/2: ApiVersionRequest failed: Local: Timed out: probably due to broker version < 0.10 (see api.version.request configuration) (after 10082ms in state APIVERSION_QUERY, 1 identical error(s) suppressed)
The implementation of the Consumer is very simple:
var config = new ConsumerConfig
{
BootstrapServers = "172.25.16.200:9092",
GroupId = args[0],
AutoOffsetReset = AutoOffsetReset.Latest,
EnableAutoCommit = true,
EnableAutoOffsetStore = true,
ClientId = args[1] != null ? args[1] : args[0]
};
var t = new ConsumerBuilder<Ignore, MessageObject>(config);
t.SetValueDeserializer(new MessageObjectDeserializer());
using (var consumer = t.Build())
{
consumer.Subscribe("kraft-test");
var cancellationToken = new CancellationToken();
while (true)
{
var consumeResult = consumer.Consume(cancellationToken);
}
}
I currently don't know how to get the connection established and why the Consumer has such an issue but the Producer won't.
Cheers, Frank
Same here, but with a Python lib.
Can you provide more debug logs?