pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] jiazhai commented on a change in pull request #3312: Prevent dup consumers on same client cnx with shared subscription
Date Tue, 22 Jan 2019 03:54:07 GMT
jiazhai 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_r249634660
 
 

 ##########
 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:
   This method can be called many times in a single tests, and each time a new `pulsarclient`
is created, but they are not explicitly closed. While in the original logic, once test completed
it will call `client.close()`. From my view it would be better to return each new created
pulsarClient, and close the one that additionally added.  

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

Mime
View raw message