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

addListener and getConfig used different path #4247

Closed
2 tasks
uglycow opened this issue Jun 4, 2019 · 0 comments
Closed
2 tasks

addListener and getConfig used different path #4247

uglycow opened this issue Jun 4, 2019 · 0 comments
Milestone

Comments

@uglycow
Copy link
Contributor

uglycow commented Jun 4, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.2
  • Operating System version: xxx
  • Java version: xxx

Steps to reproduce this issue

public void removeListener(String key, String group, ConfigurationListener listener) {
        cacheListener.removeListener(key, listener);
    }

    @Override
    public String getConfig(String key, String group, long timeout) throws IllegalStateException {
        /**
         * when group is not null, we are getting startup configs from Config Center, for example:
         * group=dubbo, key=dubbo.properties
         */
        if (StringUtils.isNotEmpty(group)) {
            key = group + "/" + key;
        }
        /**
         * when group is null, we are fetching governance rules, for example:
         * 1. key=org.apache.dubbo.DemoService.configurators
         * 2. key = org.apache.dubbo.DemoService.condition-router
         */
        else {
            int i = key.lastIndexOf(".");
            key = key.substring(0, i) + "/" + key.substring(i + 1);
        }

        return (String) getInternalProperty(rootPath + "/" + key);
    }

addListener and getConfig used different path, so only one of the could get data from configcenter

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

What do you expected from the above steps?

Actual Result

What actually happens?

If there is an exception, please attach the exception trace:

Just put your stack trace here!
@chickenlj chickenlj added this to the 2.7.3 milestone Jun 13, 2019
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

No branches or pull requests

2 participants