Skip to content

avoid create new subscription name for reader if it's already configed#11586

Merged
eolivelli merged 1 commit into
apache:masterfrom
aloyszhang:sub-name
Aug 8, 2021
Merged

avoid create new subscription name for reader if it's already configed#11586
eolivelli merged 1 commit into
apache:masterfrom
aloyszhang:sub-name

Conversation

@aloyszhang

Copy link
Copy Markdown
Contributor

Motivation

For a reader, pulsar will create a new subscription name first without checking whether it's existed or not.

 String subscription = "multiTopicsReader-" + DigestUtils.sha1Hex(UUID.randomUUID().toString()).substring(0, 10);
        if (StringUtils.isNotBlank(readerConfiguration.getSubscriptionRolePrefix())) {
            subscription = readerConfiguration.getSubscriptionRolePrefix() + "-" + subscription;
        }
if (StringUtils.isNotBlank(readerConfiguration.getSubscriptionName())) {
            subscription = readerConfiguration.getSubscriptionName();
        }

This pull request aims to avoid create a new subscription name for reader if it's already set before.

Modifications

Check subscription from the ReaderConfigurationData first and if already exist, we do not need to create a subscription name.

Verifying this change

This change is a trivial rework without any test coverage.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): ( no)
  • The public API: ( no)
  • The schema: ( no)
  • The default values of configurations: ( no)
  • The wire protocol: ( no)
  • The rest endpoints: ( no)
  • The admin cli options: ( no)
  • Anything that affects deployment: ( now)

Documentation

no document need be added or updated since this change has nothing to do with API and configuration

@aloyszhang

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@eolivelli
eolivelli merged commit 177ea06 into apache:master Aug 8, 2021
@aloyszhang
aloyszhang deleted the sub-name branch November 30, 2021 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants