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

@ApolloConfigChangeListener interestedKeyPrefixes When can dynamic parameterization be supported #4866

Open
wormsStorm opened this issue May 9, 2023 · 4 comments
Assignees
Labels
area/client apollo-client feature request Categorizes issue as related to a new feature.

Comments

@wormsStorm
Copy link

I hope the @ ApolloConfigChangeListener interestedKeyPrefixes can support dynamic parameters。I would like to know whether it is not supported now or there is a problem with the use;

@Value("${my.prefix}")
private String myPrefix;

@Autowired
private ConfigurableApplicationContext context;

@ApolloConfigChangeListener(value = {"${apollo.bootstrap.namespaces}"}, interestedKeyPrefixes = "#{myPrefix}")
private void onChange(ConfigChangeEvent changeEvent) {
    //handle change event
    if (!changeEvent.changedKeys().isEmpty()) {
        context.publishEvent(new RefreshEvent(this, changeEvent, "Apollo Refresh"));
    }
}

If not now, when will it be?

@nobodyiam
Copy link
Member

I believe the dynamic value is supported with pr #3349, but I'm not sure whether interestedKeyPrefixes is supported cc @Anilople

@Anilople
Copy link
Contributor

I believe the dynamic value is supported with pr #3349, but I'm not sure whether interestedKeyPrefixes is supported cc @Anilople

According https://github.com/apolloconfig/apollo/pull/3349/files#diff-c24a6923b6a3196c6148e0d2e9a8b7784ff71d30b91550dae96dad798c03014cR121

      final String resolvedNamespace = this.environment.resolveRequiredPlaceholders(namespace);
      Config config = ConfigService.getConfig(resolvedNamespace);

interestedKeyPrefixes in annotation @ApolloConfigChangeListener didn't resolve yet.

@Anilople Anilople added feature request Categorizes issue as related to a new feature. area/client apollo-client labels May 15, 2023
@huxleyliau
Copy link

🔔 Is anyone working on this? I'll implement dynamic parameterization when I have some free time.

@nobodyiam
Copy link
Member

@huxleyliau That sounds great! I just assigned this issue to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client apollo-client feature request Categorizes issue as related to a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants