Hi,

 •      In case if there are SFTP receivers at the end of the branch(es) of
Parallel Multicast, the payload gets corrupted in 1 or more branches.
     o    Any 1 branch / Some SFTP receivers may not receive the full data in
the respective SFTP file(s).

 
While validating it with a simple example (SFTP->parallel multicast->2*SFTP
in 2 different branches): A test with a large payload showed that both
receiver files were created but as soon as one is finished the other one
stops too. This already indicates that there are no two different streams
that are processed but just one stream that is handed to the SFTP endpoints. 


Even the trace log showed that if there is cache output stream, the same was
used by the SFTP receivers / endpoints in both the branches:

*Debug Trace:*
2015 01 13
08:45:21#+00#DEBUG#org.apache.camel.component.file.remote.SftpOperations##anonymous#Camel
(Test_Multicast) thread #7 - Multicast##avatarmercury#itjkmerct1#ifl##About
to store file: rec2 using stream:
*org.apache.camel.converter.stream.FileInputStreamCache@11ef331a|*
2015 01 13
08:45:21#+00#DEBUG#org.apache.camel.component.file.remote.SftpOperations##anonymous#Camel
(Test_Multicast) thread #6 - Multicast##avatarmercury#itjkmerct1#ifl##*About
to store file: rec1 using stream:
org.apache.camel.converter.stream.FileInputStreamCache@11ef331a|*


Both use the same stream instance. 
MulticastProcessor.createProcessorExchangePairs seems to create the copies.
The copying is based on Exchange.copy and Message.copy. Message.copy does
not copy the streams which is required for the mulicast to work properly
with streams. 

We could circumvent the issue, if we convert the payload / body  from cache
outputstream to byte[] before the multicast  or just before the SFTP
endpoints in the multicast branches (i.e. using  ${in.bodyAs(byte[])} 
within camel:simple ). 

This problem does not come in Sequential multicast.

Can you please let us knoiw if this is an issue 9or) already fixed?

Thanks,
Lakshmi







--
View this message in context: 
http://camel.465427.n5.nabble.com/Data-Corruption-in-SFTP-in-Parallel-Multicast-branches-tp5761673.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to