天天看點

MuleSoft知識總結-17.将配置資訊放到properties檔案中前言properties

文章目錄

  • 前言
  • properties

前言

在前端或後端的開發中我們通常都會設定properties檔案或者yaml檔案對配置資訊的值進行統一的管理,這樣友善管理,并且當我們需要修改配置資訊的值時,可以直接修改properties檔案或yaml檔案中的值。

properties

  1. 在src/main/resources下建立檔案config.properties
    MuleSoft知識總結-17.将配置資訊放到properties檔案中前言properties
  2. 回到global.xml檔案中,确定需要改變的配置資訊的值。
    MuleSoft知識總結-17.将配置資訊放到properties檔案中前言properties
    MuleSoft知識總結-17.将配置資訊放到properties檔案中前言properties
    MuleSoft知識總結-17.将配置資訊放到properties檔案中前言properties
  3. 将這些配置資訊的值寫到config.properties檔案中。
    MuleSoft知識總結-17.将配置資訊放到properties檔案中前言properties
  4. 添加配置檔案資訊,在global.xml點選Create選擇Global Configurations下的Configuration properties
    MuleSoft知識總結-17.将配置資訊放到properties檔案中前言properties
  5. 選擇之前建立好的config.properties檔案
    MuleSoft知識總結-17.将配置資訊放到properties檔案中前言properties
  6. 将配置資訊替換為${XXX}
    MuleSoft知識總結-17.将配置資訊放到properties檔案中前言properties
    MuleSoft知識總結-17.将配置資訊放到properties檔案中前言properties
  7. 啟動Mule APP使用PostMan進行測試
    MuleSoft知識總結-17.将配置資訊放到properties檔案中前言properties

繼續閱讀