Claudio Mattioni created NIFI-15934:
---------------------------------------
Summary: 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
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)