pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [pulsar] sijie commented on a change in pull request #3746: [java client] Bugfix prevent dup consumers for same topic subscription
Date Tue, 05 Mar 2019 17:00:14 GMT
sijie commented on a change in pull request #3746: [java client] Bugfix prevent dup consumers
for same topic subscription
URL: https://github.com/apache/pulsar/pull/3746#discussion_r262590243
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java
 ##########
 @@ -688,8 +688,10 @@ public void reloadLookUp() throws PulsarClientException {
     private <T> Optional<ConsumerBase<T>> subscriptionExist(ConsumerConfigurationData<?>
conf) {
         synchronized (consumers) {
             Optional<ConsumerBase<?>> subscriber = consumers.keySet().stream()
-                    .filter(consumerBase -> consumerBase.getSubType().equals(PulsarApi.CommandSubscribe.SubType.Shared))
+                    .filter(c -> c.getSubType().equals(PulsarApi.CommandSubscribe.SubType.Shared))
+                    .filter(c -> conf.getTopicNames().contains(c.getTopic()))
 
 Review comment:
   > In order to do this we still need a mechanism to identify consumers already instantiated
with something like these
   
   yes your change in this PR is still needed.
   
   > increment refCount on such consumer, do you agree?
   
   yes
   
   > So, the whole refCount would be useful to avoid real call on close() until the very
last close() is called (refCount == 0) isn't ?
   
   Correct. My proposal is extending your PR to have a ref count mechanism to address `close`
issue.

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


With regards,
Apache Git Services

Mime
View raw message