Spring Cloud Config Client Without Spring Boot

前端 未结 5 1707
猫巷女王i
猫巷女王i 2020-12-02 10:23

We have an existing spring web app deployed as a WAR file into Amazon Elastic Beanstalk. Currently we load properties files as http resources to give us a single source of p

5条回答
  •  离开以前
    2020-12-02 11:07

    I have similar requirement; I have a Web Application that uses Spring XML configuration to define some beans, the value of the properties are stored in .property files. The requirement is that the configuration should be loaded from the hard disk during the development, and from a Spring Cloud Config server in the production environment.

    My idea is to have two definition for the PropertyPlaceholderConfigurer; the first one will be used to load the configuration from the hard disk :

            
            
                
                    dcm.properties
                    post_process.properties
                
            
        
    

    The second one will load the .properties from the Spring Config Server :

        
            
                
                    http://localhost:8888/trunk/dcm-qa.properties
                
            
        
    

提交回复
热议问题