apache camel - How to throw an Exception if file on ftp is locked? Spring DSL

My route is polling from endpointftp://localhost:21/folder?username=user&password=password&delay=15s&move=processed&moveFailed=error&sendEmptyMessageWhenIdle=true&passiveMode=true.If I just add readLock=rename, Camel will ignore troublesome file and leave it in folder.How to implement camel behavior so that if file is still being locked by somebody after readLockTimeout or n attempts, Camel will not skip the file, but throw an Exception....Read more

FTP upload in passive mode not working, It opens data connection and times out with "Data channel timed out."

220 Microsoft FTP Serviceuser user331 Password required for user.pass pass230-Directory has 543,777,456,128 bytes of disk space available.230 User logged in.pwd257 "/" is current directory.cwd aa6250 cwd command successful.pwd257 "/aa6" is current directory.pasv227 Entering Passive Mode (*,*,*,*,201,182).stor sampleprogram150 Opening ASCII mode data connection.425 Data channel timed out.The above is the FTP done using command-line. When I check with FTP client there is a file with 0 size created....Read more

ftp - IBM MQ for file transfer

We are facing a choice to use IBM MQ over SFTP for file transfer. I've heard advantages of such approach, but I've never see anyone actually using it for a large files. So main question: how well IMB MQ can handle transfer of large files (up to 100 MB)? Is it stable? It's from mainframe to UNIX server, if it does matter.Thanks a lot....Read more

FTP not working in apache camel

I was trying apache camel built in examples for ftp and incorporate with springboot. When executing neither I am getting an error message not file download. Below is the code snippet and logs. From the logs I could see server is connected succesfully, but I am not able to see the file in /tmp/ folder.2016-03-18 15:21:02.744 INFO 2103 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.16.2 (CamelContext: camel-1) is starting2016-03-18 15:21:02.744 INFO 2103 --- [ main] o.a.c.m.ManagedManagementStrategy ...Read more

apache camel - FuseFabric for FTP/File failover endpoints?

I am creating a camel project which polls the local directory and pushes the files to a FTP location. I want to apply failover mechanism to my design. If want another fuse instance to be ready, if the current node fails. Without any failover, two fuse instances can together poll the files. But I wanted the second node to poll the files, when the first node fails. Is this scenario possible if I use FuseFabric ? I dont want anyother product choice, I have this product with me. But I want to know whether I can achieve this using Fabric ?I am sure,...Read more

How to rename and move the file on FTP once processed by camel?

I have several folders on my ftp: /csv/xml/processed/....How can I rename and move each file once it has been processed from file.csv to file.done and move it to processed folder ? I have tried many options like adding tons of parameters to "from" or add something into onCompletion or adding several more routes for just moving files.All placeholders contain correct values and are processed by Spring. <route> <from uri="ftp://{{ftp.user}}@{{ftp.server}}/{{inbound.csv}}?password={{ftp.pass}}&amp;binary=true&amp;includ...Read more

Apache Camel FTP - What is the best practice between a context start and stop

I wrote some code to download a file from an FTP site looks like below:CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { public void configure() { from( uri ).to( localBox ); } }); context.start(); // a tedious sleepy thread !? // TODO: work around for a better solution Thread.sleep(20000); context.stop();I am looking for a better solution instead of Thread.sleep method. Is it also possible to get how much time has left for finishing the transfer? Thank...Read more

ftp file upload with camel

i'm trying to upload file via ftp using camel. My code is the followingpublic static void main(String... args) throws Exception { CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { @Override public void configure() { from("file:src/data?noop=true").to(""); } }); context.start(); Thread.sleep(10000); context.stop();}It connects fine but (as you can see in the log ) but when i'm trying to store...Read more

How to transfer file from PC (windows 7) to Mainframe either using script or FTP?

I want to transfer from my local drive to mianframe either using script or FTP without opening mainframe .Please help me .Any help is valuable .Thanks in advance.I tried this Step1:Start --> Run --> CommandStep2: Enter the following command FTP XX.XXX.XX.XXXWhere XX.XXX.XX.XXX is the ip address of mainframe Step3: When you are prompted for user name and password, provide your mainframe id and mainframe passwordStep4:To Upload the file to mainframe from PCPUT D:\MYFILES\TEST.TXT 'FILE.ON.MAINFRAM'...............PUT "PC file path (e.g. c:\xxxxx...Read more

Camel FTP Fails to retrieve files based on the include filter

I am using Apache camel 2.13.2 and am trying to connect to an FTP to retrieve files based on the file expression given in the include parameter. I can see that there are files in the folder in the ftp account, but camel doesn't pull the files. I can see in the log that the connection is successful, but the exchange is returned as null. The same code works for other ftp accounts. Could someone help to understand on where I am doing wrong, and things that I could try to get this fixed?ftp://XXXXXXX@XXXXXXX.XXXXXXX.XXX:21/testfolder/testfold/te...Read more

Apache Camel throw alert when no files pulled from FTP after X time

I've written a camel route that pulls files from a FTP server and does some message transformations onto them. An example scenario is that I'm polling the FTP server every 1 hour. If no files have been pulled for the last 12 hours however, I want to send an alert notification.I've read through this other stackoverflow question and added the sendEmptyMessageWhenIdle=true option so I can tell when no new messages have been polled. However I only want to send an alert if no messages have been polled after X time. I've been thinking of using a time...Read more

Apache camel connecting to redirected ftp

I have the following simple camel program trying to poll a ftp server for filespublic class GetFilesFromFtp { public static void main(String[] args) throws Exception{ CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { public void configure() { from("ftp://<USER>@f<FTPHOST>/<FOLDER>?password=<PASSWORD>&passiveMode=true") .to("file:data/outbox"); } }); context.start(); Thread.sleep(10000); context.stop(); }}The program wor...Read more

apache camel - Issues with a route configuration that has multiple consumer endpoints on the same ftp

The Camel documentation says "The FTP consumer (with the same endpoint) does not support concurrency (the backing FTP client is not thread safe). You can use multiple FTP consumers to poll from different endpoints. It is only a single endpoint that does not support concurrent consumers." is with a route configuration that has multiple consumer endpoints on the same ftp server, with the same accounts, but different path:Pseudo code:<from uri="ftp:localhost/input01?username=test&password=test...Read more