[
https://issues.apache.org/jira/browse/NIFI-15934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18106421#comment-18106421
]
ASF subversion and git services commented on NIFI-15934:
--------------------------------------------------------
Commit 36289e7404f12e5c38a092dd4828b69e735486b3 in nifi's branch
refs/heads/main from ing-mattioni
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=36289e7404f ]
NIFI-15934 Added Maximum Input FlowFile Size to PublishAMQP (#11242)
- Added handling for empty header keys in PublishAMQP
Signed-off-by: David Handermann <[email protected]>
> PublishAMQP should handle oversized FlowFiles and ignore empty AMQP header
> keys
> -------------------------------------------------------------------------------
>
> Key: NIFI-15934
> URL: https://issues.apache.org/jira/browse/NIFI-15934
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Affects Versions: 2.9.0
> Reporter: Claudio Mattioni
> Assignee: Claudio Mattioni
> Priority: Major
> Labels: AMQP
> Time Spent: 3h 50m
> Remaining Estimate: 0h
>
> PublishAMQP currently reads FlowFile content into a byte array before
> publishing the AMQP message. Since Java arrays require an int-sized length,
> FlowFiles larger than Integer.MAX_VALUE cannot be published using this path
> and can fail with an unsafe cast or allocation behavior.
> PublishAMQP should detect FlowFiles larger than Integer.MAX_VALUE before
> attempting to allocate the message byte array, log an error, penalize the
> FlowFile, and route it to failure.
> In addition, AMQP header attributes parsed from FlowFile attributes can
> currently produce entries with empty header keys. Empty AMQP header keys
> should be ignored instead of being added to the headers map.
> Proposed changes:
> - Validate FlowFile size before byte-array extraction.
> - Route oversized FlowFiles to failure with penalization.
> - Use Math.toIntExact when converting FlowFile size to byte array length.
> - Ignore empty AMQP header keys when parsing header attributes.
> - Add test coverage for oversized FlowFiles and empty AMQP header keys.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)