eolivelli commented on a change in pull request #9853:
URL: https://github.com/apache/pulsar/pull/9853#discussion_r591173267
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -2510,8 +2510,13 @@ private int getMessageTTL() throws Exception {
public CompletableFuture<Void> addSchemaIfIdleOrCheckCompatible(SchemaData
schema) {
return hasSchema()
.thenCompose((hasSchema) -> {
- if (hasSchema ||
isActive(InactiveTopicDeleteMode.delete_when_no_subscriptions)
- || ledger.getTotalSize() != 0) {
+ int numActiveConsumers = subscriptions.values().stream()
+ .map(subscription ->
subscription.getConsumers().size())
+ .reduce(0, Integer::sum);
Review comment:
Sorry, this is a working example
```
int numActiveConsumers = subscriptions.values().stream()
.mapToInt(subscription ->
subscription.getConsumers().size())
.sum();
```
btw this is not a big deal, no need to change
----------------------------------------------------------------
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]