Apache Camel does not save file in source folder

While working with Apache Camel, whenever a file is encrypted using camel splash screen or copied via canel-ftp, Camel moves the file to the .Camel folder and does not save it in the original folder after processing, I want my file to remain in the original folder after processing is complete. Please advice on how to achieve the same.

CamelContext context = new DefaultCamelContext (); context.addRoutes (new RouteBuilder () {

        @Override
        public void configure() throws Exception {

            from("file:src/main/zip?delete=false").marshal().zipFile()
                    .to("file:C:/Users/kdewan/Desktop");
        }

    });
    context.start();
    Thread.sleep(5000);
    context.stop();

      

+3


source to share


2 answers


Please check the "noop" property in the Camel-File component.
By default it is "false" so that it will move the processing folder. camel.
If you don't want to move it to the .camel folder, make the "noop" property "true" .



+2


source


Camel moves files to the .Camel directory to avoid processing the same file multiple times. The Ftp component inherits all parameters from the file component , so you can specify a different location as the archive directory:

ftp:...&move=directory/archive&moveFailed=directory/error

      

move: this is the archive directory where the processed files are stored

moveFailed: this is the directory when an error occurred during processing



I believe the same logic can be used for the zip camel as well.

When I use a file component, I create this structure in my file system for better monitoring:

-- basic/Directory
---- /working
---- /archive
---- /error

      

+3


source







All Articles