Sounds a bit like you are aggregating the 2 ftp files into a single message.
There is an EIP for that http://camel.apache.org/aggregator2 On Wed, Oct 2, 2013 at 6:54 PM, Zulio84 <[email protected]> wrote: > Hello everybody, > > I'm trying to achieve the following scenario: > > 1. read a file using the FTP component, once you read the contents of this > file via another endpoint FTP i fetch a second file; (In both cases, I use > the inputstream content in the body). > > 2. Now I would like to replace the body of the first exchange with the body > of the second. > > I'm managing very large files, I would not buffer the message, but simply > replace the reference of the inputstream. > > I tried with the following statement: > > InputStream is = sourceExchange.getIn ().getBody(InputStream.class); > destExchange.getIn (). setBody (is, InputStream.class); > > and the variants: > > a) InputStream is = sourceExchange.getIn (). getBody (InputStream.class); > destExchange.getIn (). setBody (is); > > b) destExchange.getIn (). setBody (sourceExchange.getIn (). getBody > (InputStream.class)); > > c) destExchange.getIn (). setBody (sourceExchange.getIn (). getBody ()); > > When I go to read the stream forward in the route, the stream is not valid, > it's empty. > > Someone can 'help me? Thank you. > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Camel-Ftp-tp5740774.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
