You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/01/23 15:34:51 UTC

[GitHub] lovelle commented on a change in pull request #3312: Prevent dup consumers on same client cnx with shared subscription

lovelle commented on a change in pull request #3312: Prevent dup consumers on same client cnx with shared subscription
URL: https://github.com/apache/pulsar/pull/3312#discussion_r250245440
 
 

 ##########
 File path: pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/MockedPulsarServiceBaseTest.java
 ##########
 @@ -110,7 +111,11 @@ protected final void internalSetup() throws Exception {
         if (isTcpLookup) {
             lookupUrl = new URI("pulsar://localhost:" + BROKER_PORT);
         }
-        pulsarClient = PulsarClient.builder().serviceUrl(lookupUrl.toString()).statsInterval(0, TimeUnit.SECONDS).build();
+        setPulsarClient(lookupUrl.toString(), 0);
+    }
+
+    protected void setPulsarClient(String url, int intervalInSecs) throws PulsarClientException {
 
 Review comment:
   Great! what do you think about having this on `setPulsarClient` method like :
   ```java
   protected void setPulsarClient(String url, int intervalInSecs) throws PulsarClientException {
       if (pulsarClient != null) {
           pulsarClient.close();
       }
       pulsarClient = PulsarClient.builder().serviceUrl(url).statsInterval(intervalInSecs, TimeUnit.SECONDS).build();
   }
   ```
   maybe would be better to rename `setPulsarClient` to something like `resetPulsarClient` ?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services