Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-6231

Camel Split doesn't processes the payload of the file, received via FTP

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 2.10.4
    • None
    • camel-ftp
    • None
    • Unknown

    Description

      I'm having troubles trying to create a route that splits files received from FTP.

      Here is the configuration (in Spring DSL):

      <camelContext id="receiveFTP" trace="true" xmlns="http://camel.apache.org/schema/spring" >
      	<threadPoolProfile id="receiveFTP-splitter-profile"
                                 defaultProfile="false" poolSize="20"
                                 maxPoolSize="30"/>
      	<!-- Endpoints -->
      	<endpoint id="FileOutput" uri="file:D:/Temp/camel-test/ftpReceive/?fileName=Received_${exchangeId}_${file:onlyname}" />
      	<endpoint id="FTPSource" uri="ftp://192.168.21.11:21/folder/?pollStrategy=#ftpPollStrategy&amp;throwExceptionOnConnectFailed=true&amp;binary=false&amp;passiveMode=true&amp;readLock=rename&amp;delete=true&amp;moveFailed=.failed&amp;include=.*\.txt&amp;delay=1000&amp;localWorkDirectory=../../camel_temp/&amp;username=username&amp;password=password&amp;maxMessagesPerPoll=100&amp;consumer.bridgeErrorHandler=true" />
      
      	<!-- Routes -->
      	<route id="ReceiveFromFTP">
      		<from ref="FTPSource" />
      		<threads poolSize="1" maxPoolSize="1">
      			<split streaming="true" parallelProcessing="true" executorServiceRef="receiveFTP-splitter-profile">
      				<tokenize token="\r\n"/>
      				<to ref="FileOutput"/>
      			</split>
      		</threads>
      	</route>
      </camelContext>
      

      The FTP location contains a file with several lines, I'm trying to split it, and in the output location I have one file with the following content:

      -rw-r--r-- 1 ftp ftp            141 Apr 02 08:04 FTP_ftpTest.txt_20130402081001301.txt

      Looks like the Split component doesn't take the payload of the received file. Even more, adding <convertBodyTo type="java.lang.String"/> before splitting resolves the problem. But I assume this is not expected behavior.

      Attachments

        Activity

          People

            njiang Willem Jiang
            igor.ivaniuk@intellecteu.com Igor Ivaniuk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: