1

I am using the Mule Requestor to receive a collection of files via FTP.

Request FTP file collection retrieval

In order to do this with a collection I am using the Collection Splitter which works great. The only problem is that when I am returning to the HTTP Connector it throws the following exception:

java.lang.UnsupportedOperationException: getPayloadAsBytes(), use getPayload(DataType.BYTE_ARRAY_DATA_TYPE)

I am guessing this has something to do with the payload type that is trying to be inserted into the response, but I am fairly new in the Mule arena. Any idea what could be causing this and what I should do to resolve the issue?

I have tried setting the payload after the logger, that didn't work.

Code:

<flow name="fileGetter">     
  <http:listener config-ref="HTTP_Listener_Configuration" path="/test" doc:name="HTTP" allowedMethods="GET"></http:listener>
  <mulerequester:request-collection config-ref="Mule_Requester" resource="ftp_For_Requester_Dependent" doc:name="Mule Requester</mulerequester:request-collection>  
  <collection-splitter doc:name="Collection Splitter"></collection-splitter>
  <logger level="INFO" doc:name="Logger" message="#[message.inboundProperties.originalFilename]"></logger>  
</flow>
4

1 回答 1

3

您得到的原因java.lang.UnsupportedOperationException: getPayloadAsBytes(), use getPayload(DataType.BYTE_ARRAY_DATA_TYPE)很明显,因为您正在拆分有效负载,最后您的 HTTP 会导致问题,因为会有拆分响应。一种解决方案是,在流程结束时
使用聚合器,这样可以防止出现这种异常。
最后的 A<collection-aggregator/>将是一个不错的选择,并有助于防止这种情况发生

UPDATE
保持它处于<async>阻塞状态,它将成功运行

于 2015-08-08T04:30:05.483 回答