zhaijack closed pull request #1526: make connection timeout config-able for 
consumer and producer
URL: https://github.com/apache/incubator-pulsar/pull/1526
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
index a446dd4567..ccdfaf78fd 100644
--- 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
+++ 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
@@ -184,7 +184,9 @@
         }
 
         this.connectionHandler = new ConnectionHandler(this,
-            new Backoff(100, TimeUnit.MILLISECONDS, 60, TimeUnit.SECONDS, 0, 
TimeUnit.MILLISECONDS),
+            new Backoff(100, TimeUnit.MILLISECONDS,
+                client.getConfiguration().getOperationTimeoutMs(), 
TimeUnit.MILLISECONDS,
+                0, TimeUnit.MILLISECONDS),
             this);
 
         grabCnx();
diff --git 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
index 92a512de2b..901a465a6e 100644
--- 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
+++ 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
@@ -181,7 +181,9 @@ public ProducerImpl(PulsarClientImpl client, String topic, 
ProducerConfiguration
         }
 
         this.connectionHandler = new ConnectionHandler(this,
-            new Backoff(100, TimeUnit.MILLISECONDS, 60, TimeUnit.SECONDS, 
Math.max(100, conf.getSendTimeoutMs() - 100), TimeUnit.MILLISECONDS),
+            new Backoff(100, TimeUnit.MILLISECONDS,
+                client.getConfiguration().getOperationTimeoutMs(), 
TimeUnit.MILLISECONDS,
+                Math.max(100, conf.getSendTimeoutMs() - 100), 
TimeUnit.MILLISECONDS),
             this);
         grabCnx();
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

Reply via email to