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?
4条答案
按热度按时间ndasle7k1#
I believe the dynamic value is supported with pr #3349 , but I'm not sure whether interestedKeyPrefixes is supported cc @Anilople
9wbgstp72#
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
interestedKeyPrefixes in annotation
@ApolloConfigChangeListener
didn't resolve yet.olhwl3o23#
🔔 Is anyone working on this? I'll implement dynamic parameterization when I have some free time.
gcxthw6b4#
@huxleyliau That sounds great! I just assigned this issue to you.