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

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

Merged
merged 1 commit into from
Aug 8, 2021

Conversation

aloyszhang
Copy link
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
Contributor Author

/pulsarbot run-failure-checks

Copy link
Contributor

@eolivelli eolivelli left a comment

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