BewareMyPower commented on pull request #9853:
URL: https://github.com/apache/pulsar/pull/9853#issuecomment-794656764
> We need to check if there are producers or consumers connect to this topic.
> Check no subscriptions is equals to no consumers.
So even the consumer has closed, it's still treated as *connected*? Take my
test as the example
```java
try (Consumer<byte[]> consumer
=
pulsarClient.newConsumer(Schema.BYTES).topic(topic2).subscriptionName("sub").subscribe())
{
}
try (Consumer<String> consumer
=
pulsarClient.newConsumer(Schema.STRING).topic(topic2).subscriptionName("sub").subscribe())
{
}
```
During the `ServerCnx#handleSubscribe` for the second consumer, the
subscriptions is not empty. However the first consumer has already closed.
----------------------------------------------------------------
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:
[email protected]