Mule ESB:Context Property Placeholder

后端 未结 7 1449
暖寄归人
暖寄归人 2021-02-20 06:48

I have a question regarding Mule\'s context property placeholder, I have two files set up like this:



        
7条回答
  •  我寻月下人不归
    2021-02-20 07:32

    I have also come across the same scenario. Below is the outcome of my practical experience:

    1. If both files exists either inside project or server, both will be loaded during the project/app startup. In case the files are not available, it will throw exception (java.io.FileNotFoundException : The system cannot find the file specified) while running the application.

    2. It is quite interesting to use multiple properties files and to know the precedence. In this case both property files will be loaded and hence properties defined inside both files will be loaded during the run time. However, mule always gives preference to the lastly declared file in case same properties are defined in both files and additional attribute like order hasn't been defined.

      For Example if there is a property "db.dbname=test_university" declared inside
      "mule-app-1.properties" and "db.dbname=university" inside "mule-app-2.properties" then ${db.dbname} inside config xml will load "university"

提交回复
热议问题