Dear community,

We have a problem (of understanding) concerning Camel streaming.

In our use case we pick up 3 large files with Camel SFTP component 
(&streamDownload=true&stepwise=false). We aggregate the 3 files and write the 
aggregation per SFTP to a server. Due to the sizes of the input files, we have 
to stream.
We have 2 approaches, but none works as expected.

1.     For the aggregation of the 3 Java InputStreams, we use 
java.io.SequenceInputStream 
(https://docs.oracle.com/javase/7/docs/api/java/io/SequenceInputStream.html)
This means that our Exchange body holds a SequenceInputStream after the 
aggregation. The SFTP producer  accepts the SequenceInputStream, since 
SequenceInputStream extends InputStream, but the SFTP producer does not write 
all 3 streams included in the SequenceInputStream (somehow it only writes one 
of the 3 streams, but all 3 streams are included!).

2.     For the aggregation of the 3 Java InputStreams, we use 
org.apache.camel.converter.stream.CachedOutputStream and Camel stream caching. 
This works, but as soon as we use aggregation in our routes, the tmp file for 
the CachedOutputStream, which is created by stream caching, is never deleted.

How would you solve this problem? I would prefer a solution without writing tmp 
files. As we already spent a lot of time on this use case, I would appreciate 
any help. Thank you.

Camel Version: 3.4.2
JDK: 13


Regards,
Flo



[cid:image86f0b9.PNG@1f264e9b.428d9e59]<https://www.spar-ics.com/>

Florian EIBL
Software Engineer
Business Automation & Integration
<http://>
Phone:  +43 664 6259733
Mobile: +43 664 6259733
E-Mail: florian.e...@spar-ics.com<mailto:florian.e...@spar-ics.com>

SPAR Business Services GmbH
Information & Communication Services
Europastrasse 3, 5015 Salzburg, Austria

<http://>

                [cid:imagee1de8d.PNG@e08ed63b.4cb584cd]

Sollten Sie diese E-Mail unbeabsichtigt bzw. irrtümlich erhalten haben, so 
weisen wir Sie darauf hin, dass gemäß § 93 Abs 4 TKG der Inhalt sowie die 
Tatsache des Empfangs dieser E-Mail weder aufgezeichnet noch verwertet oder 
Unbefugten mitgeteilt werden dürfen. Wir ersuchen Sie, die Nachricht von Ihrem 
System zu löschen und sich mit uns in Verbindung zu setzen.

If you have received this email accidentally or in error, we point out that, in 
accordance with § 93 para. 4 TKG (Telecommunications Act), the contents of this 
email and the fact of its receipt must not be recorded, exploited or 
communicated to unauthorized persons. We ask you to delete the message from 
your system and to contact us.


Reply via email to