austince commented on a change in pull request #16023:
URL: https://github.com/apache/flink/pull/16023#discussion_r644107434



##########
File path: 
flink-connectors/flink-connector-rabbitmq/src/main/java/org/apache/flink/streaming/connectors/rabbitmq/common/RMQConnectionConfig.java
##########
@@ -90,12 +94,16 @@ private RMQConnectionConfig(
             Integer requestedChannelMax,
             Integer requestedFrameMax,
             Integer requestedHeartbeat,
-            Integer prefetchCount) {
+            Integer prefetchCount,
+            Long deliveryTimeout) {
         Preconditions.checkNotNull(host, "host can not be null");
         Preconditions.checkNotNull(port, "port can not be null");
         Preconditions.checkNotNull(virtualHost, "virtualHost can not be null");
         Preconditions.checkNotNull(username, "username can not be null");
         Preconditions.checkNotNull(password, "password can not be null");
+        Preconditions.checkArgument(
+                deliveryTimeout == null || deliveryTimeout >= 0,
+                "deliveryTimeout can not be negative");

Review comment:
       Can we split this into two checks or update the error message to account 
for null? 

##########
File path: 
flink-connectors/flink-connector-rabbitmq/src/main/java/org/apache/flink/streaming/connectors/rabbitmq/common/RMQConnectionConfig.java
##########
@@ -132,8 +141,12 @@ private RMQConnectionConfig(
             Integer requestedChannelMax,
             Integer requestedFrameMax,
             Integer requestedHeartbeat,
-            Integer prefetchCount) {
+            Integer prefetchCount,
+            Long deliveryTimeout) {
         Preconditions.checkNotNull(uri, "Uri can not be null");
+        Preconditions.checkArgument(
+                deliveryTimeout == null || deliveryTimeout >= 0,
+                "deliveryTimeout can not be negative");

Review comment:
       Same comment here about splitting the checks or updating the message. 

##########
File path: 
flink-connectors/flink-connector-rabbitmq/src/main/java/org/apache/flink/streaming/connectors/rabbitmq/common/RMQConnectionConfig.java
##########
@@ -506,16 +532,44 @@ public Builder setPrefetchCount(int prefetchCount) {
             return this;
         }
 
+        /**
+         * Enables setting the next message delivery timeout in the queueing 
consumer. Only
+         * applicable to the {@link RMQSource}. Set to 0 for unlimited (the 
consumer will be blocked
+         * until an element becomes available). Default is 30000.
+         *
+         * @param deliveryTimeout maximum wait time, in milliseconds, for the 
next message delivery
+         * @return the Builder
+         */
+        public Builder setDeliveryTimeout(int deliveryTimeout) {
+            this.deliveryTimeout = deliveryTimeout;

Review comment:
       nit, any reason not to just `return setDeliveryTimeout(deliveryTimeout, 
TimeUnit.MILLISECONDS)` and avoid the duplication? 




-- 
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.

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


Reply via email to