apache-cameljbossfuse

Fuse/Camel: How to stop after downloading just one file


Fuse/Camel newbie here. I'm trying to automate a manual process where .done files are downloaded from an FTP host, then renamed "fileout.txt", and finally an AS/400 program is executed on that file.

However, the department hosting the AS/400 program doesn't have resources to update their programming. The solution I'm working toward is to have Camel download one file at a time, save it as "fileout.txt", then execute a JT400 program to process it. Individually those steps work but I'm left with one problem.

What I pray you, dear reader, can help me with is "How can I stop Camel after downloading just one file? (since overwriting, appending, or downloading multiple files won't work for the following step)".


Solution

  • How can I stop Camel after downloading just one file?

    You can set following parameters in FTP consumer

    Then, your ftp route can trigger an asynchronous message (maybe wireTap component) to another route to trigger controlBus component to stop the ftp route by route id.

    I'm trying to automate a manual process where .done files are downloaded from an FTP host, then renamed fileout.txt, and finally an AS/400 program is executed on that file

    Other than stop/start your route, you may try pollEnrich component with FTP usage. Using pollEnrich, you can trigger FTP consumer once when needed if you know the target file name already.