Mule请求程序-FTP-有效负载类型字节数组不是输入流
我正在处理一个非常大的csv文件,并使用Mule Requester读取文件的内容。 我配置了一个ftp连接器,并将流设置为“true”,但是,当我尝试记录负载时,我可以看到Mule请求程序返回一个字节数组,这意味着它将把文件的所有内容加载到内存中,我不希望这样 以下是我的流程:Mule请求程序-FTP-有效负载类型字节数组不是输入流,ftp,mule,esb,Ftp,Mule,Esb,我正在处理一个非常大的csv文件,并使用Mule Requester读取文件的内容。 我配置了一个ftp连接器,并将流设置为“true”,但是,当我尝试记录负载时,我可以看到Mule请求程序返回一个字节数组,这意味着它将把文件的所有内容加载到内存中,我不希望这样 以下是我的流程: <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:batch="http://www.mulesoft.org/schem
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:batch="http://www.mulesoft.org/schema/mule/batch" xmlns:mulerequester="http://www.mulesoft.org/schema/mule/mulerequester" xmlns:quartz="http://www.mulesoft.org/schema/mule/quartz" xmlns:ftp="http://www.mulesoft.org/schema/mule/ee/ftp" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/ftp http://www.mulesoft.org/schema/mule/ee/ftp/current/mule-ftp-ee.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/mulerequester http://www.mulesoft.org/schema/mule/mulerequester/current/mule-mulerequester.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/quartz http://www.mulesoft.org/schema/mule/quartz/current/mule-quartz.xsd
http://www.mulesoft.org/schema/mule/batch http://www.mulesoft.org/schema/mule/batch/current/mule-batch.xsd">
<ftp:connector name="FTP" pollingFrequency="1000" streaming="true" validateConnections="true" doc:name="FTP"/>
<flow name="mulerequesterstreamFlow1" processingStrategy="synchronous">
<quartz:inbound-endpoint jobName="streamingTest" repeatInterval="15000" responseTimeout="10000" doc:name="Quartz">
<quartz:event-generator-job/>
</quartz:inbound-endpoint>
<flow-ref name="mulerequesterstreamFlow" doc:name="mulerequesterstreamFlow"/>
</flow>
<flow name="mulerequesterstreamFlow" processingStrategy="synchronous">
<mulerequester:request resource="ftp://vagrant:vagrant@192.168.1.9:21/home/vagrant/read_directory?connector=FTP" throwExceptionOnTimeout="true" doc:name="Mule Requester" />
<choice doc:name="Choice">
<when expression="#[payload != empty]">
<logger message="payload is not empty #[payload]" level="INFO" doc:name="Logger - payload"/>
</when>
<otherwise>
<logger message="empty payload" level="INFO" doc:name="Logger - log when payload is empty"/>
</otherwise>
</choice>
</flow>
</mule>
每当您试图传递csv文件时,请确保在选择范围之前使用transformer,并在选择范围中拖动另一个transformer和logger以获得结果,通过在选择范围流中引用您正在使用的transformer来提及选择范围的“何时”条件,并将logger放在每个范围内,确保不要将转换器放在foreach作用域内。每当您尝试传递csv文件时,请确保在选择作用域之前使用transformer,并在选择作用域中拖动另一个转换器和记录器以获得结果,请提及“何时”通过在选择范围流中引用正在使用的转换器,并将记录器放在每个范围内,以使其进行迭代,来确定选择范围的条件。确保不要将转换器放在foreach范围内。为简单起见,为什么要将
与流引用一起使用
,我已经删除了围绕这些流的其他逻辑,但这对于这个问题不是必需的。您正在使用的逻辑可能已经将您的负载转换为字节[]
。mulerequester
和选项之间是否存在逻辑关系。不,mulerequester和choice之间没有逻辑,因此它不应该将有效负载转换为字节[]。上面的流工作并记录Mule请求程序返回的有效负载类型,类型为Byte[]。为简单起见,您为什么要将
与流引用一起使用,而不是
,我已经删除了围绕这些流的其他逻辑,但这对于这个问题不是必需的。您正在使用的逻辑可能已经将您的负载转换为字节[]
。mulerequester
和选项之间是否存在逻辑关系。不,mulerequester和choice之间没有逻辑,因此它不应该将有效负载转换为字节[]。上面的流程工作并记录Mule请求程序返回的负载类型,类型为Byte[]。感谢您的回答,但这与我的问题无关。我的问题是我得到了一个Byte[]类型的有效负载,我希望在这里有一个流。谢谢你的回答,但这与我的问题无关。我的问题是我得到了一个Byte[]类型的有效负载,在这里我需要一个流。
payload is not empty [B@3ac94399