apolloconfig / apolloconfig/apollo

@ApolloConfigChangeListener interestedKeyPrefixes When can dynamic parameterization be supported

Ouverte
#4,866 5 commentaires 0 réactions 1 personne assignée Réclamée par @huxleyliau Voir sur GitHub
area/client feature request
Langage dominant
Java
Étoiles
29.8k
Forks
10.2k
Merge moyen
4 j 7 h
PR mergées (30 j)
4

Description

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?

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.