ftp 파일을 처리하기위한 낙타 경로에서 형식 변환에 어려움을 겪고 있습니다.낙타 ftp 경로 및 파일 형식 변환기
<route id="processIncomingFtpFile" errorHandlerRef="parkingCitErrHandler">
<from uri="{{ftp.parkingcit.input.path}}"/>
<bean ref="ftpZipFileHandler"/>
<unmarshal ref="bindyCsvFormat"/>
<bean ref="parkingTicketsHandler"/>
<split>
<simple>${body}</simple>
<marshal ref="jaxbFormatter"/>
<convertBodyTo type="java.io.File"/>
<to uri="{{ftp.parkingcit.output.path}}"/>
</split>
</route>
그리고 내 핸들러의 서명은 다음과 같습니다 : 내 경로 (봄 DSL에서) 다음과 같습니다
public File handleIncomingFile(File incomingfile)...
그러나,이 산출 다음과 같은 유형의 변환 문제 :
org.apache.camel.InvalidPayloadException: No body available of type: java.io.File but has value: RemoteFile[test.zip] of type: org.apache.camel.component.file.remote.RemoteFile on: test.zip. Caused by: No type converter available to convert from type: org.apache.camel.component.file.remote.RemoteFile to the required type: java.io.File with value RemoteFile[test.zip]. Exchange[test.zip]. Caused by: [org.apache.camel.NoTypeConversionAvailableException - No type converter available to convert from type: org.apache.camel.component.file.remote.RemoteFile to the required type: java.io.File with value RemoteFile[test.zip]]
내 질문은 : 내가 내 FTP 파일을 메모리에서 처리 할 수 있어야하는지, 명시 적으로 낙타에게 디스크에 쓰기를 말하지 않고, 형식 변환기가 나를 위해 자동으로 작업을 수행하는 것인가? 또는 내 처리기가 입력 매개 변수로 java.io.File을 원한다는 것을 감안할 때, 내가 무의미한 짓을하려는 것입니다. 즉,이 작업을 수행하려면 데이터를 디스크에 작성해야합니다.
당신이 그것을 지적 했으니 이제 분명해 보입니다. 감사. –