Spring云配置客户端-Java配置HashMap或属性
我是微服务、euereka和spring的新手 我想启动我的Eureka客户端,从我在启动包含云信息的应用程序之前创建的HashMap中获取值Spring云配置客户端-Java配置HashMap或属性,spring,spring-boot,netflix-eureka,spring-cloud-netflix,spring-cloud-config,Spring,Spring Boot,Netflix Eureka,Spring Cloud Netflix,Spring Cloud Config,我是微服务、euereka和spring的新手 我想启动我的Eureka客户端,从我在启动包含云信息的应用程序之前创建的HashMap中获取值 HashMap config = new HashMap (); config.put ("spring_cloud_config_enabled", "true"); config.put ("spring_application_name", "MicroService"); config.put ("spring_profiles_active",
HashMap config = new HashMap ();
config.put ("spring_cloud_config_enabled", "true");
config.put ("spring_application_name", "MicroService");
config.put ("spring_profiles_active", "default");
config.put ("spring_cloud_config_uri", "http://myHost:8888");
如果为空,请访问bootstrap.properties信息
有人知道我怎么做吗?
谢谢大家! 以下是弹簧应用中加载特性的顺序:
我不确定我们是否了解对方。也许我不理解你。。。我使用这个ConfigServicePropertySourceLocator.getRemoteEnvironment()(覆盖)从我的云获取信息,比如:[PropertySource[name=file:/root/Cloud/Cloud-configuration/testService/default/application.yml]使用Resources eureka客户端信息,如端口或uri…我应该在哪里使用它来启动我的客户端。如果可能,您可以在示例回购上托管您的代码片段,以便我可以查看您当前的方法并提供更好的见解?