In my case I want to connect to sftp servers dynamically as I can have multiple sftp servers, so I can’t create a bean with default session factory as it will be singleton right? can you suggest some solution?
Great video..Thank u so much.. I have some doubt on this. Instead of auto start, I wanted to start it and once downloaded want to stop it. How this can be done? Could you please help me on this? I have tried the autoStart flag, but it just doesn't start. Could not figure out how do I start
Great video! I have a question about how to delete the local version of the file once you are done processing. I've tried doing file.delete() at the end of handleIncomingMessage method, but the file does not get deleted. Is there a special way to delete local files with Spring Integration? Thanks for the help!
Hi friend, how can I download file on event-based (on demand) using Spring SFTP integration - InboundChannelAdapter, instead of listening to the SFTP server
Thank You for this video !! It is working only on start up, after that it is getting disconnected from sftp server , after printing below message in logs. RSA key fingerprint is ******************* Are you sure you want to continue connecting? can you please help me
You need add accept unknown keys or add the keys manually: public DefaultSftpSessionFactory gimmeFactory(){ DefaultSftpSessionFactory factory = new DefaultSftpSessionFactory(); factory.setHost("0.0.0.0"); factory.setPort(22); factory.setAllowUnknownKeys(true); factory.setUser("mike"); factory.setPassword("password123"); return factory; } Here is the code: github.com/ekim197711/springintegration-sftpmessagehandler/blob/master/src/main/java/com/codeinvestigator/springbootsftpmessagehandler/download/SftpSynchConfiguration.java
how can I download 1 file with 1 path as a Resource. I don't want to save the file to the local machine. for example, I call API with the parameter path file. my service calls to sftp server and gets the file as a Resource.
Yes it is. If you want to control it your self then use Apache Common FTPClient commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPClient.html
Hi, I can see the same code in an application but it cause connection leak issue in sftp server how can I close that... I think it not closing the session and use the connection continuously.... FYI POLLER every 2sec
Thanks for the wonderful presentation. A couple of questions : 1) how would this work in a clustered environment, where this is deployed into many nodes. Will multiple nodes download the same file? 2) If after downloading the file is not deleted, will the file still show up in the a subsequent poll? Is there is a way to mark the file as read other than to physically delete it from the stpfolder?
@@MikesTechCorner Thanks for the quick reply. Just for some clarification on the cluster side of things, if one nodes starts to download a file, no other node would pick it up? this is not about sftp being deployed into many nodes. This is about the poller being deployed into many nodes
Thank you my friend, i wish you the best of this life!
Thank you! You too!
Looks so simple and easy. Gotta love Spring. :)
SZ try to watch the K6 demo and let me know what you think. Its pretty good for perf. testing.
@@MikesTechCorner After watching the video I can say that I really like K6. :) Simple to use and powerful.
Ty a lot bro. Very nice explanation. also subbed.
Thank you
In my case I want to connect to sftp servers dynamically as I can have multiple sftp servers, so I can’t create a bean with default session factory as it will be singleton right?
can you suggest some solution?
Look at cloud buckets instead. Then you don't have to maintain it. Software as a service rocks. :)
How can I connect to 0.0.0.0 ?
0.0.0.0 or 127.0.0.1 are just local addresses to your network interface. If you use docker expose the port before connecting
nice video i want to see part 2 where you create database with this files information later :)
Thanks for the idea!
Thanks for this example. I have a query that how can we read & process multiple files from SFTP directory using Spring Integration using Spring Boot ?
Try to watch the other sftp and Spring videos that I have made.
Great video..Thank u so much..
I have some doubt on this.
Instead of auto start, I wanted to start it and once downloaded want to stop it.
How this can be done? Could you please help me on this?
I have tried the autoStart flag, but it just doesn't start. Could not figure out how do I start
I don't know. Why do you want to stop listenening for files? Just ignore extra files.
Great video! I have a question about how to delete the local version of the file once you are done processing. I've tried doing file.delete() at the end of handleIncomingMessage method, but the file does not get deleted. Is there a special way to delete local files with Spring Integration? Thanks for the help!
Hmmm try to create a new file object with same path and delete that?
Hi friend,
how can I download file on event-based (on demand) using Spring SFTP integration - InboundChannelAdapter, instead of listening to the SFTP server
Interesting topic. What kind of event? But yes you have to implement the custom code then
Is there way to delete files from the remote server based on a filter using spring integration?
You send delete request for each file.
@@MikesTechCorner thanks i was able to find a way
Thank You for this video !!
It is working only on start up, after that it is getting disconnected from sftp server , after printing below message in logs.
RSA key fingerprint is *******************
Are you sure you want to continue connecting?
can you please help me
You need add accept unknown keys or add the keys manually:
public DefaultSftpSessionFactory gimmeFactory(){
DefaultSftpSessionFactory factory = new DefaultSftpSessionFactory();
factory.setHost("0.0.0.0");
factory.setPort(22);
factory.setAllowUnknownKeys(true);
factory.setUser("mike");
factory.setPassword("password123");
return factory;
}
Here is the code:
github.com/ekim197711/springintegration-sftpmessagehandler/blob/master/src/main/java/com/codeinvestigator/springbootsftpmessagehandler/download/SftpSynchConfiguration.java
how can I download 1 file with 1 path as a Resource. I don't want to save the file to the local machine.
for example, I call API with the parameter path file. my service calls to sftp server and gets the file as a Resource.
You can open an output stream and then load the file as an input stream.
hi friend! i have a trouble, my handleIncomingFile method didn`t call. can you help what`s wrong?
Clone my repo and check file by file and check whats missing. Check the log for errors. Ok?
Hi what about the session closure...where we need to close
Yes it is. If you want to control it your self then use Apache Common FTPClient commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPClient.html
Hi,
I can see the same code in an application but it cause connection leak issue in sftp server how can I close that... I think it not closing the session and use the connection continuously.... FYI POLLER every 2sec
Thanks for the wonderful presentation. A couple of questions :
1) how would this work in a clustered environment, where this is deployed into many nodes. Will multiple nodes download the same file?
2) If after downloading the file is not deleted, will the file still show up in the a subsequent poll? Is there is a way to mark the file as read other than to physically delete it from the stpfolder?
No delete the file or move to a folder named "done" or something. Regard cluster setup then the sftp instances would share same volumes
@@MikesTechCorner Thanks for the quick reply. Just for some clarification on the cluster side of things, if one nodes starts to download a file, no other node would pick it up? this is not about sftp being deployed into many nodes. This is about the poller being deployed into many nodes
@@navd1488 no the file is not locked. Move it to a "inprog" folder or place a metainfo file next to it
@@MikesTechCorner thank you very much :)
Hello sir, How to disconnect and connect session in ftp?
Try to clone my git projects
Hi, how can we download all the files from the remote directory during one poll? Loved your teaching bdw...
List the files and dl one by one
@@MikesTechCorner the session.list() to be done in ServiceActivator level or InboundChannelAdapter level???
is there a way for it to download files in subfolers as well?
Yes you have to list all folders and download the files 1 by 1. It's just a couple of loops / methods.
How to get notifications after deleted..? Please suggest some advice
Please suggest can I listen the delete event after file got deleted..? Any filter implementation..?