WSO2 ESB FileConnector合并文件未产生预期结果
我正在使用WSO2 ESB 6.5.0,并使用fileconnector-2.0.21版本进行文件操作。我正在构建的代理服务旨在从某个源路径读取文件,并将内容合并到目标路径的文件中 代理服务工件的内容如下所示WSO2 ESB FileConnector合并文件未产生预期结果,wso2,wso2esb,wso2ei,Wso2,Wso2esb,Wso2ei,我正在使用WSO2 ESB 6.5.0,并使用fileconnector-2.0.21版本进行文件操作。我正在构建的代理服务旨在从某个源路径读取文件,并将内容合并到目标路径的文件中 代理服务工件的内容如下所示 <?xml version="1.0" encoding="UTF-8"?> <proxy name="FileMergeProxy" startOnLoad="true" transports="http https" xmlns="http://ws.apache.o
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="FileMergeProxy" startOnLoad="true" transports="http https" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<log description="Combine files" level="custom" separator="| ">
<property name="statusMessage" value="Processing complete"/>
<property name="fileCreation" value="Initiating file merge"/>
<property expression="$ctx:mergeDirPath" name="sourceDir"/>
<property expression="$ctx:finalDirPath" name="destDir"/>
<property expression="$ctx:outputFilePattern" name="pattern"/>
<property expression="fn:concat('file:///', $ctx:mergeDirPath)" name="sourceDir1" scope="default" type="STRING"/>
property expression="fn:concat('file:///', $ctx:finalDirPath)" name="destDir1" scope="default" type="STRING"/>
</log>
<fileconnector.mergeFiles>
<source>{$ctx:mergeDirPath}</source>
<destination>{$ctx:finalDirPath}</destination>
<filePattern>{$ctx:outputFilePattern}</filePattern>
</fileconnector.mergeFiles>
<log description="Processing complete" level="custom" separator="| ">
<property name="doneMessage" value="File merge processing complete"/>
</log>
</inSequence>
<outSequence/>
<faultSequence>
<log level="custom">
<property name="text" value="An unexpected error occured"/>
<property expression="get-property('ERROR_MESSAGE')" name="message"/>
<property expression="get-property('ERROR_DETAIL')" name="errordetail"/>
</log>
<send description="Send Error Information"/>
</faultSequence>
</target>
</proxy>
在将构件部署到ESB引擎后调用服务时,它在目标路径中创建一个空文件,而不合并源目录中文件的内容。这是WSO2日志的摘录
[2020-03-23 12:48:36,683] [] INFO - LogMediator To: /services/FileMergeProxy,MessageID: urn:uuid:b569ec6a-d4fe-4763-a0ca-fb2eb868a31e correlation_id : a1c542bb-7fac-4e0b-9582-8cb1a605f618,Direction: request,Payload: { "mergeDirPath": "C://temp//merge//", "finalDirPath": "C://temp//final//finalcontent.txt", "outputFilePattern": "\\*txt" }
[2020-03-23 12:49:00,422] [] INFO - LogMediator statusMessage = Combine files| fileCreation = Initiating file merge| sourceDir = C://temp//merge//| destDir = C://temp//final//finalcontent.txt| pattern = \*txt| sourceDir1 = file:///C://temp//merge//| destDir1 = file:///C://temp//final//finalcontent.txt
[2020-03-23 12:49:02,943] [] INFO - LogMediator doneMessage = File merge processing complete
除非我在这里遗漏了什么,否则mergeFiles不应该完全这样做吗?将文件的内容合并到指定的目录中?欢迎提供任何有用的建议或建议。提前感谢。根据您共享的代理,您已经在日志中介中定义了属性。定义日志中介外部的属性。根据您共享的代理,您已经在日志中介内部定义了属性。在日志中介之外定义属性。谢谢您的建议。然而,这也不起作用。这就好像序列只是忽略了那个特定的步骤,然后进入序列中的下一个步骤。谢谢你的建议。然而,这也不起作用。这就好像序列只是忽略了那个特定的步骤,然后进入序列中的下一个步骤。
[2020-03-23 12:48:36,683] [] INFO - LogMediator To: /services/FileMergeProxy,MessageID: urn:uuid:b569ec6a-d4fe-4763-a0ca-fb2eb868a31e correlation_id : a1c542bb-7fac-4e0b-9582-8cb1a605f618,Direction: request,Payload: { "mergeDirPath": "C://temp//merge//", "finalDirPath": "C://temp//final//finalcontent.txt", "outputFilePattern": "\\*txt" }
[2020-03-23 12:49:00,422] [] INFO - LogMediator statusMessage = Combine files| fileCreation = Initiating file merge| sourceDir = C://temp//merge//| destDir = C://temp//final//finalcontent.txt| pattern = \*txt| sourceDir1 = file:///C://temp//merge//| destDir1 = file:///C://temp//final//finalcontent.txt
[2020-03-23 12:49:02,943] [] INFO - LogMediator doneMessage = File merge processing complete