dan-s1 commented on code in PR #8146:
URL: https://github.com/apache/nifi/pull/8146#discussion_r1424500623


##########
nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/ConsumeAMQP.java:
##########
@@ -112,6 +112,16 @@ public class ConsumeAMQP extends 
AbstractAMQPProcessor<AMQPConsumer> {
         .defaultValue("10")
         .required(true)
         .build();
+    static final PropertyDescriptor PREFETCH_COUNT = new 
PropertyDescriptor.Builder()
+        .name("prefetch.count")
+        .displayName("Prefetch Count")
+        .description("The maximum number of unacknowledged messages for the 
consumer. If consumer has this number of unacknowledged messages, AMQP broker 
will "
+               + "no longer send new messages until consumer acknowledges some 
of the messages already delivered to it. 0 means no limit")
+        .addValidator(StandardValidators.NON_NEGATIVE_INTEGER_VALIDATOR)
+        .expressionLanguageSupported(ExpressionLanguageScope.NONE)
+        .defaultValue("0")
+        .required(true)
+        .build();

Review Comment:
   Per the [Rabbit 
javadocs](https://rabbitmq.github.io/rabbitmq-java-client/api/4.x.x/com/rabbitmq/client/Channel.html#basicQos)
 it seems the prefetch count must be an integer between 0 and 65535. You should 
add logic to `AbstractAMQPProcessor#customValidate`  in order to ensure the 
integer entered is between 0 and  65535 and not greater.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to