nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Geercken" <>
Subject Nifi 1.3.0 - Problems with ConsumeKafkaRecord_0_10
Date Thu, 22 Jun 2017 19:30:59 GMT
Hello everyone,
I wanted to try the following
- get messages from a kafka topic. these are simple messages in CSV format
- use the PartitionRecord processor to get familiar with the RecordPath concept
I started zookeeper and kafka on localhost and added some messages to a topic using the kafka
concole producer. A message looks like this:
I can retrieve this message using the kafka concole consumer.
To my flow I added the ConsumeKafkaRecord_0_10 and the PartitionRecord processor. I configured
the ConsumeKafkaRecord_0_10 with a CSVReader controller. It uses the AvroSchemaRegistry 1.3.0
with following schema:
"type": "record",
"name": "flight_schema",
"fields": [
   { "name": "flight_station", "type": "string" },
   { "name": "flight_orientation", "type": "string" },
   { "name": "flight_carrier", "type": "string" },
   { "name": "flight_number", "type": "string" },
   { "name": "flight_number_suffix", "type": "string" },
   { "name": "flight_scheduled_date", "type": "string" },
   { "name": "flight_scheduled_time", "type": "string" },
   { "name": "flight_actual_date", "type": "string" },
   { "name": "flight_actual_time", "type": "string" },
   { "name": "flight_passengers", "type": "int" }
And then I have a CSVRecordWriter which uses the same schema. I also added a line to logback.xml
to debug the ConsumeKafkaRecord_0_10 processor.
Now when I run the processors and add a message to the topic in kafka I get following error:

2017-06-22 18:32:11,228 ERROR [Timer-Driven Process Thread-7] o.a.n.p.k.pubsub.ConsumeKafkaRecord_0_10
ConsumeKafkaRecord_0_10[id=cb353b32-015c-1000-0ed2-0753cceaa542] Exception while processing
data from kafka so will close the lease org.apache.nifi.processors.kafka.pubsub.ConsumerPool$SimpleConsumerLease@4f137cc2
due to org.apache.nifi.processor.exception.ProcessException: java.lang.NullPointerException:
org.apache.nifi.processor.exception.ProcessException: java.lang.NullPointerException
org.apache.nifi.processor.exception.ProcessException: java.lang.NullPointerException
    at org.apache.nifi.processors.kafka.pubsub.ConsumerLease.writeRecordData(
    at org.apache.nifi.processors.kafka.pubsub.ConsumerLease.lambda$processRecords$8(
    at java.util.HashMap$KeySpliterator.forEachRemaining(
    at org.apache.nifi.processors.kafka.pubsub.ConsumerLease.processRecords(
    at org.apache.nifi.processors.kafka.pubsub.ConsumerLease.poll(
    at org.apache.nifi.processors.kafka.pubsub.ConsumeKafkaRecord_0_10.onTrigger(
    at org.apache.nifi.processor.AbstractProcessor.onTrigger(
    at org.apache.nifi.controller.StandardProcessorNode.onTrigger(
    at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$
    at java.util.concurrent.Executors$
    at java.util.concurrent.FutureTask.runAndReset(
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(
    at java.util.concurrent.ScheduledThreadPoolExecutor$
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$
Caused by: java.lang.NullPointerException: null
    at org.apache.nifi.processors.kafka.pubsub.ConsumerLease.writeRecordData(
    ... 18 common frames omitted
I have played around with the settings of the processors and controllers quite a lot, but
always get this NullPointerException.
I then added a ConsumeKafka_0_10 1.3.0 processor to verify that I can retrieve the messages
and it does work.
I hope that someone can point out what the problem is and help me.

View raw message