camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CY Kan <>
Subject Re: SFTP Handshake
Date Sun, 28 Jun 2009 14:44:21 GMT


Thank you for quick reply. Yes, it's to receive data files from mainframe.

I tried the following code and had some problem encountered.

public class MyReadyFileStrategy<T> extends
GenericFileProcessStrategySupport<T> {

	public boolean begin(GenericFileOperations<T> arg0, GenericFileEndpoint<T>
			GenericFileExchange<T> arg2, GenericFile<T> arg3) throws Exception {
		super.begin(arg0, arg1, arg2, arg3);

                List<GenericFile<T>> files = (List<GenericFile<T>>
                AssertNotNull( "No GenericFileOperations!", arg0 );
                AssertNotNull( "No files!", files );

The first assert is true while the second isn't. The method listFiles()
returns nothing and so the existence of "completed.txt" cannot be checked.
Is there any problem on listFiles()?

Thank you again.

Claus Ibsen-2 wrote:
> Hi
> Yeah that strategy used by good old mainframes? Easier to write a new
> filer rather than rename/move the actual file.
> Camel can do this but it would require a little additional coding as
> you need to implement your own process strategy.
> With 2.0m2 you implement you own GenericFileProcessStrategy interface.
> And in the begin method you use the listFiles() method on the
> operations to see if the "complete.txt" file is there.
> Return true | false depending on the file exists.
> In the commit operation you move the actual file and delete the
> complete.txt file.
> The operations interface have methods for that.
> The only issue I see is that the file consumer will log WARN if begin
> returns false.
> I think we should reduce that to DEBUG as it is a valid strategy for
> you. I will do that in my next commit.
> On Sat, Jun 27, 2009 at 12:26 PM, CY Kan<> wrote:
>> Hi,
>> I'm trying Camel 2.0-M2 and can't figure out how to realize the scenario
>> below:
>> 1. System A exports records to a file named records.txt in an sftp server
>> folder.
>> 2. to avoid read/write concurrency issue, System A creates another file
>> named "completed" in the folder after records.txt is made. In other
>> words,
>> seeing "completed" means ready for file download.
>> 3. System B polls the sftp server folder for "completed".
>> 4. If "completed" is found, System B donwloads records.txt.
>> 5. System B archives records.txt in another folder and deletes
>> "completed"
>> after download complete.
>> I think it's something like Aggregator + Filter but failed. The problem
>> is
>> the download of records.txt needs postponed until "completed" is found.
>> Could you suggest if Camel is good at this sort of thing or any other
>> idea?
>> Thank you in advance.
>> --
>> View this message in context:
>> Sent from the Camel - Users mailing list archive at
> -- 
> Claus Ibsen
> Apache Camel Committer
> Open Source Integration:
> Blog:
> Twitter:

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message