This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Apache Camel FTP: Publishing Content to FTP Servers with Camel FTP Component.  RSS feed

 
Dilip H Pashupathi
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was working on a service where the User Interface sends out two files in JSON format (A .js file) as Multipart. This I have already done. But problem is different. When the file is sent to FTP server and if the FTP server fails to respond or has problem connecting to FTP server, then I am not able to catch hold of that exception in any way. Below is the code piece

Process that should happen:

1. At the root folder of the FTP, there is file that needs to be deleted
2. Before deleting that file, the file should be taken as a backup and placed in one of the subdirectory.
3. After that from the request I need read the data and produce a file that should be placed in the ftp root directory.

For all the above only a single FTP server is available and there are three different calls happening.
First call is to download the file from
ftp_site/somefile.js
Pass this on to
ftp_site/backup
Read the file from request params and place it in
ftp_site/somefile_update_<date_time>.js



And this is how my FTP URL Looks like
URL 1: Consumer URL for downloading the file
ftp://XXXXC@localhost:8899/?password=XXXXC&consumer.bridgeErrorHandler=true&throwExceptionOnConnectFailed=true&maximumReconnectAttempts=0&useList=true&delete=true

URL 2: Producer URL for moving to backup folder and adding current date to the fileName
ftp://XXXXC@localhost:8899/backup?password=XXXXC&consumer.bridgeErrorHandler=true&throwExceptionOnConnectFailed=true&maximumReconnectAttempts=0&useList=true&fileName=${file:name.noext}_${date:now:yyyyMMdd.hhmmss}.js


ftp://XXXX@localhost:8899/?password=XXXX&consumer.bridgeErrorHandler=true&throwExceptionOnConnectFailed=true&maximumReconnectAttempts=0

Since URL 1 and URL 2 is written inside the processor when exception happens like unable to connect to FTP, onException is not able to handle that properly. And the route ends with a lot of stack trace.

And all of this is happening with only one single FTP server. No additional servers are available for the same.

Kindly help as this is a bit urgent and I need to deliver the service soon.

Thanks & Regards
Dilip H Pashupathi
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!