Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Duplicate
-
0.9.0.0
-
None
-
None
Description
I 'm unning a brand new Kafka cluster (version 0.9.0.0). During my tests I noticed this error at Consumer.partitionsFor during a full cluster restart.
My DEV cluster is made of 4 brokers
I cannot reproduce the problem consistently but it heppens sometimes during the restart of the brokers
This is my code:
this.properties = new Properties();
properties.put("bootstrap.servers", "list of servers"));
properties.put("acks", "all");
properties.put("retries", 0);
properties.put("batch.size", 16384);
properties.put("linger.ms", 1);
properties.put("buffer.memory", 33554432);
properties.put("group.id", "test");
properties.put("session.timeout.ms", "30000");
properties.put("key.deserializer", "org.apache.kafka.common.serialization.ByteArrayDeserializer");
properties.put("value.deserializer", "org.apache.kafka.common.serialization.ByteArrayDeserializer");
String topic = "xxx”;
try (KafkaConsumer<byte[], byte[]> consumer = new KafkaConsumer<>(properties)
This is the error:
java.lang.NullPointerException
at org.apache.kafka.common.requests.MetadataResponse.<init>(MetadataResponse.java:130)
at org.apache.kafka.clients.consumer.internals.Fetcher.getTopicMetadata(Fetcher.java:203)
at org.apache.kafka.clients.consumer.KafkaConsumer.partitionsFor(KafkaConsumer.java:1143)
at magnews.datastream.KafkaDataStreamConsumer.fetchNewData(KafkaDataStreamConsumer.java:44
Attachments
Attachments
Issue Links
- duplicates
-
KAFKA-2880 Fetcher.getTopicMetadata NullPointerException when broker cannot be reached
- Resolved