指定命名空间的方式

1. 启动类上注解指定
@EnableApolloConfig({"MY_NAMESPACE", "OTHER_NAMESPACE"})
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
2. 在配置文件properties或bootstrap指定
app.id=your-app-id # Apollo 中注册的应用ID
apollo.meta=http://your-apollo-meta-server:8080 # Apollo 配置中心地址
apollo.cacheDir=/opt/data # 本地缓存路径(可选)
apollo.autoUpdateInjectedSpringProperties=true # 开启属性自动更新(可选)
3. 在applicatio配置
app:
id: oss-golaid
apollo:
meta: http://localhost:8812
bootstrap:
enabled: true
eagerLocad:
enabled: true
namespaces: application_dev