[
https://issues.apache.org/jira/browse/NIFI-4046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16044419#comment-16044419
]
ASF GitHub Bot commented on NIFI-4046:
--------------------------------------
GitHub user markap14 opened a pull request:
https://github.com/apache/nifi/pull/1906
NIFI-4046: If we are unable to parse out any records from a Kafka Mes…
…aage with ConsumeKafkaRecord, then we should route all of the bytes
received to 'parse.failure'
Thank you for submitting a contribution to Apache NiFi.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
- [ ] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number
you are trying to resolve? Pay particular attention to the hyphen "-" character.
- [ ] Has your PR been rebased against the latest commit within the target
branch (typically master)?
- [ ] Is your initial contribution a single, squashed commit?
### For code changes:
- [ ] Have you ensured that the full suite of tests is executed via mvn
-Pcontrib-check clean install at the root nifi folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the LICENSE file, including the main
LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main
NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to
.name (programmatic access) for each of the new properties?
### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in
which it is rendered?
### Note:
Please ensure that once the PR is submitted, you check travis-ci for build
issues and submit an update to your PR as soon as possible.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/markap14/nifi NIFI-4046
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/1906.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1906
----
commit c1bced8bbf4e0152ef5b46c7dfeb1000d4efbf3c
Author: Mark Payne <[email protected]>
Date: 2017-06-09T13:02:08Z
NIFI-4046: If we are unable to parse out any records from a Kafka Mesaage
with ConsumeKafkaRecord, then we should route all of the bytes received to
'parse.failure'
----
> ConsumeKafkaRecord can throw NPE if using an Avro Reader and data on topic is
> missing a required field
> ------------------------------------------------------------------------------------------------------
>
> Key: NIFI-4046
> URL: https://issues.apache.org/jira/browse/NIFI-4046
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Reporter: Mark Payne
> Assignee: Mark Payne
> Fix For: 1.4.0
>
>
> I am using PublishKafkaRecord to push some data to a Kafka topic using the
> Avro writer. I not embedding the Avro schema in the content but rather using
> a Schema Registry.
> I then have a ConsumeKafkaRecord that pulls that Avro data, but is using a
> Schema that has an extra field, which is not present in the data. As a
> result, I get a NullPointerException when trying to pull data from Kafka:
> {code}
> 2017-06-08 14:54:12,499 ERROR [Timer-Driven Process Thread-22]
> o.a.n.p.k.pubsub.ConsumeKafkaRecord_0_10
> ConsumeKafkaRecord_0_10[id=84480f03-015c-1000-4aab-9a035812bb86] Exception
> while processing data from kafka so will close the lease
> org.apache.nifi.processors.kafka.pubsub.ConsumerPool$SimpleConsumerLease@6c39d011
> 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(ConsumerLease.java:514)
> at
> org.apache.nifi.processors.kafka.pubsub.ConsumerLease.lambda$processRecords$2(ConsumerLease.java:320)
> at
> java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1540)
> at
> java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
> at
> org.apache.nifi.processors.kafka.pubsub.ConsumerLease.processRecords(ConsumerLease.java:307)
> at
> org.apache.nifi.processors.kafka.pubsub.ConsumerLease.poll(ConsumerLease.java:168)
> at
> org.apache.nifi.processors.kafka.pubsub.ConsumeKafkaRecord_0_10.onTrigger(ConsumeKafkaRecord_0_10.java:327)
> at
> org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
> at
> org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1120)
> at
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:147)
> at
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
> at
> org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NullPointerException: null
> at
> org.apache.nifi.processors.kafka.pubsub.ConsumerLease.writeRecordData(ConsumerLease.java:458)
> ... 18 common frames omitted
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)