使用yaml文件Mule4进行FTP配置

使用yaml文件Mule4进行FTP配置,mule,anypoint-studio,Mule,Anypoint Studio,我在anypoint studio中为mule 4制作了一个流程。我正在努力取出硬编码的配置值,并将它们移动到配置文件中。下面是yaml配置的一个示例 config.yaml ftpconfig: host: "myhost.us" port: 21 username: "myusername" password: "mypassword" mule xml文件部分 <configuration-properties f

我在anypoint studio中为mule 4制作了一个流程。我正在努力取出硬编码的配置值,并将它们移动到配置文件中。下面是yaml配置的一个示例

config.yaml

ftpconfig:
 host: "myhost.us"
 port: 21
 username: "myusername"
 password: "mypassword"
mule xml文件部分

<configuration-properties file="config.yaml" />
<ftp:config name="FTP_Config" doc:name="FTP Config" doc:id="c34a3fbf-b37c-4c01-a3e0-36a138810e0b" >
    <ftp:connection host="${ftpconfig.host}" username="${ftpconfig.username}" password="${ftpconfig.password}" port="${ftpconfig.port}"/>
</ftp:config>


如果我将硬编码的值移动到属性中,一切都会工作。知道我做错了什么吗?

确保您的config.yaml文件位于src/main/resources下

另外,请确保config.yaml中的所有属性值都用双引号括起来(包括端口号)


如果这不起作用,请使用应用程序在引导/执行时生成的错误更新您的问题。

问题是端口号周围没有双引号。谢谢,第一次配置mule项目。