kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Enrico Olivelli - Diennea <enrico.olive...@diennea.com>
Subject NPE on 0.9.0.0 Consumer during broker restart
Date Wed, 23 Dec 2015 09:08:29 GMT
Hi,
I'm running 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

Maybe I can workaround the error doing sanity checks on cluster /using my platform middleware
tools) before instantiating the Consumer

Should I file an issue on your JIRA ?

Thanks

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);)
{
            List<PartitionInfo> partitions = consumer.partitionsFor(topic);
             ....
        }

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)

Enrico Olivelli
Software Development Manager @Diennea
Tel.: (+39) 0546 066100 - Int. 925
Viale G.Marconi 30/14 - 48018 Faenza (RA)

MagNews - E-mail Marketing Solutions
http://www.magnews.it<http://www.magnews.it/>
Diennea - Digital Marketing Solutions
http://www.diennea.com<http://www.diennea.com/>


________________________________
Iscriviti alla nostra newsletter per rimanere aggiornato su digital ed email marketing! http://www.magnews.it/newsletter/

The information in this email is confidential and may be legally privileged. If you are not
the intended recipient please notify the sender immediately and destroy this email. Any unauthorized,
direct or indirect, disclosure, copying, storage, distribution or other use is strictly forbidden.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message