You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by pv...@apache.org on 2025/05/13 08:36:00 UTC
(nifi) branch main updated: NIFI-14561 Fixed NPE in PublishAMQP due to wrong usage of Max Inbound Message Body Size property
This is an automated email from the ASF dual-hosted git repository.
pvillard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 1594dba1a5 NIFI-14561 Fixed NPE in PublishAMQP due to wrong usage of Max Inbound Message Body Size property
1594dba1a5 is described below
commit 1594dba1a5977e0d5322f780ab9bff8db2ff3a15
Author: Peter Turcsanyi <tu...@apache.org>
AuthorDate: Tue May 13 09:38:43 2025 +0200
NIFI-14561 Fixed NPE in PublishAMQP due to wrong usage of Max Inbound Message Body Size property
Signed-off-by: Pierre Villard <pi...@gmail.com>
This closes #9936.
---
.../java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/nifi-extension-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java b/nifi-extension-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java
index ad8976f61e..8702cec125 100644
--- a/nifi-extension-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java
+++ b/nifi-extension-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java
@@ -314,7 +314,11 @@ abstract class AbstractAMQPProcessor<T extends AMQPWorker> extends AbstractProce
final ConnectionFactory cf = new ConnectionFactory();
cf.setUsername(context.getProperty(USER).evaluateAttributeExpressions().getValue());
cf.setPassword(context.getProperty(PASSWORD).getValue());
- cf.setMaxInboundMessageBodySize(context.getProperty(MAX_INBOUND_MESSAGE_BODY_SIZE).evaluateAttributeExpressions().asDataSize(DataUnit.B).intValue());
+
+ // sets max message size for Consume processor
+ if (context.getProperty(MAX_INBOUND_MESSAGE_BODY_SIZE).isSet()) {
+ cf.setMaxInboundMessageBodySize(context.getProperty(MAX_INBOUND_MESSAGE_BODY_SIZE).evaluateAttributeExpressions().asDataSize(DataUnit.B).intValue());
+ }
final String vHost = context.getProperty(V_HOST).evaluateAttributeExpressions().getValue();
if (vHost != null) {