Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[broker] Enable users to set subscription expiration time for each namespace #6851

Merged
merged 1 commit into from
May 1, 2020

Conversation

massakam
Copy link
Contributor

Motivation

We can automatically delete inactive subscriptions by setting subscriptionExpirationTimeMinutes in broker.conf to a value greater than 0.

# How long to delete inactive subscriptions from last consuming
# When it is 0, inactive subscriptions are not deleted automatically
subscriptionExpirationTimeMinutes=0

However, since this setting value applies to all topics, we have to set it to 0 if there is even one topic whose subscriptions should not be deleted.

Modifications

Enable users to set a subscription expiration time for each namespace. This value overrides subscriptionExpirationTimeMinutes in broker.conf.

$ ./bin/pulsar-admin namespaces set-subscription-expiration-time --time 60 tenant1/ns1
$ ./bin/pulsar-admin namespaces get-subscription-expiration-time tenant1/ns1

60

@massakam massakam added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages area/broker area/admin labels Apr 30, 2020
@massakam massakam added this to the 2.6.0 milestone Apr 30, 2020
@massakam massakam self-assigned this Apr 30, 2020
@jiazhai jiazhai merged commit 549994b into apache:master May 1, 2020
@jiazhai jiazhai added the doc-required Your PR changes impact docs and you will update later. label May 1, 2020
@massakam massakam deleted the subscription-gc branch May 3, 2020 20:04
Huanli-Meng pushed a commit to Huanli-Meng/pulsar that referenced this pull request May 27, 2020
…pache#6851)

## Motivation

We can automatically delete inactive subscriptions by setting `subscriptionExpirationTimeMinutes` in broker.conf to a value greater than 0.
```sh
# How long to delete inactive subscriptions from last consuming
# When it is 0, inactive subscriptions are not deleted automatically
subscriptionExpirationTimeMinutes=0
```

However, since this setting value applies to all topics, we have to set it to 0 if there is even one topic whose subscriptions should not be deleted.

### Modifications

Enable users to set a subscription expiration time for each namespace. This value overrides `subscriptionExpirationTimeMinutes` in broker.conf.
```sh
$ ./bin/pulsar-admin namespaces set-subscription-expiration-time --time 60 tenant1/ns1
$ ./bin/pulsar-admin namespaces get-subscription-expiration-time tenant1/ns1

60
```
@Anonymitaet Anonymitaet removed the doc-required Your PR changes impact docs and you will update later. label Jun 3, 2020
@Anonymitaet
Copy link
Member

Doc has been added.

huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
…pache#6851)

## Motivation

We can automatically delete inactive subscriptions by setting `subscriptionExpirationTimeMinutes` in broker.conf to a value greater than 0.
```sh
# How long to delete inactive subscriptions from last consuming
# When it is 0, inactive subscriptions are not deleted automatically
subscriptionExpirationTimeMinutes=0
```

However, since this setting value applies to all topics, we have to set it to 0 if there is even one topic whose subscriptions should not be deleted.

### Modifications

Enable users to set a subscription expiration time for each namespace. This value overrides `subscriptionExpirationTimeMinutes` in broker.conf.
```sh
$ ./bin/pulsar-admin namespaces set-subscription-expiration-time --time 60 tenant1/ns1
$ ./bin/pulsar-admin namespaces get-subscription-expiration-time tenant1/ns1

60
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/admin area/broker type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants