@Retention(value=RUNTIME) @Target(value=TYPE) @Documented @Import(value=ApolloConfigRegistrar.class) public @interface EnableApolloConfig
Configuration example with multiple namespaces:
@Configuration
@EnableApolloConfig({"someNamespace","anotherNamespace"})
public class AppConfig {
}
Configuration example with placeholder:
// The namespace could also be specified as a placeholder, e.g. ${redis.namespace:xxx},
// which will use the value of the key "redis.namespace" or "xxx" if this key is not configured.
// Please note that this placeholder could not be configured in Apollo as Apollo is not activated during this phase.
@Configuration
@EnableApolloConfig({"${redis.namespace:xxx}"})
public class AppConfig {
}
public abstract String[] value
public abstract int order
Ordered.LOWEST_PRECEDENCE, which is Integer.MAX_VALUE.
If there are properties with the same name in different apollo configs, the apollo config with smaller order wins.Copyright © 2022 Ctrip, Inc.. All rights reserved.