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 2021/03/10 00:31:55 UTC
[GitHub] [pulsar] BewareMyPower commented on pull request #9853: [WIP] Fix schema not added when subscribe a topic without schema
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:
users@infra.apache.org