[ 
https://issues.apache.org/jira/browse/NIFI-14561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17951116#comment-17951116
 ] 

Peter Turcsanyi commented on NIFI-14561:
----------------------------------------

[~willboi] Thanks for the bug report and also for the analysis!

The new property is specific to the Consume processor only. The issue occurs 
when the abstract class tries to read to property in the context of the Publish 
processor where this property does not exist. It happens in the common 
[createConnection()|https://github.com/apache/nifi/blob/8d5cdc9bda414b6eb547693f9cb8906a7a3fbeba/nifi-extension-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java#L317]
 method.

Will update the code to use the property only if it is present (that is, when 
running with the Consume processor).

> PublishAMQP throws a NullPointerException
> -----------------------------------------
>
>                 Key: NIFI-14561
>                 URL: https://issues.apache.org/jira/browse/NIFI-14561
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 2.4.0
>            Reporter: Will James
>            Priority: Major
>
> Currently in version 2.4.0 of NiFi, the PublishAQMP processor fails to 
> initialize with the following bulletin error.
> {code:java}
> Failed to initialize AMQP client: java.lang.NullPointerException: Cannot 
> invoke "java.lang.Double.intValue()" because the return value of 
> "org.apache.nifi.components.PropertyValue.asDataSize(org.apache.nifi.processor.DataUnit)"
>  is null {code}
> The flowFiles then remain unprocessed in the connection to this processor and 
> nothing is able to be processed.
> This appears to be the result of the NIFI-13738 changes. 
>  
> *CAUSE*
> After investigation into the changes between 2.3.0 and 2.4.0, the addition of 
> the Max Inbound Message Body Size property is the culprit. This property is 
> required in the ABSTRACT class, but it isn't being set within the PublishAMQP 
> class. I have tried setting this manually on the processor, however the 
> Validator stops this from happening. Even though it seems there is a default 
> initialized for this property it isn't being used within the context of 
> PublishAMQP.
> Link to the affected Property: 
> [https://github.com/hr-ireh/nifi/blob/26ef065ae7bf61e2ea660d09482b4d5cdf00515d/nifi-extension-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java#L142]
>  
> The issue might be due to it not being present in the List defined here as 
> well as it being listed as a Required Value. 
> [https://github.com/hr-ireh/nifi/blob/26ef065ae7bf61e2ea660d09482b4d5cdf00515d/nifi-extension-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java#L151]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to