Тёмный

Spring Integration listen for files via SftpInboundFileSynchronizer and @InboundChannelAdapter 

Mike Møller Nielsen
Подписаться 11 тыс.
Просмотров 6 тыс.
50% 1

Listen for files on a sftp-server with Spring Integration.
Enjoy! :-)
Thank you for commenting and asking questions.
Get 25 % discount on your Minecraft servers at Shockbyte.com by using this referral link:
shockbyte.com/billing/aff.php...
The code is located here:
github.com/ekim197711/springi...
Follow me on twitter:
/ mikemoelnielsen
Support me on Patreon:
/ mikemoellernielsen
As an Amazon Associate I earn from qualifying purchases.
Check out the stuff that I like (always updated):
kit.co/MikeMoelNielsen/cool-s...

Наука

Опубликовано:

 

5 янв 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 48   
@Korekt01
@Korekt01 4 года назад
Looks so simple and easy. Gotta love Spring. :)
@MikesTechCorner
@MikesTechCorner 4 года назад
SZ try to watch the K6 demo and let me know what you think. Its pretty good for perf. testing.
@Korekt01
@Korekt01 4 года назад
@@MikesTechCorner After watching the video I can say that I really like K6. :) Simple to use and powerful.
@zavzen4963
@zavzen4963 4 года назад
Ty a lot bro. Very nice explanation. also subbed.
@MikesTechCorner
@MikesTechCorner 4 года назад
Thank you
@dvdvasconcelos
@dvdvasconcelos 2 года назад
Thank you my friend, i wish you the best of this life!
@MikesTechCorner
@MikesTechCorner 2 года назад
Thank you! You too!
@denisr.8248
@denisr.8248 2 года назад
nice video i want to see part 2 where you create database with this files information later :)
@MikesTechCorner
@MikesTechCorner 2 года назад
Thanks for the idea!
@DaBomb225
@DaBomb225 3 года назад
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!
@MikesTechCorner
@MikesTechCorner 3 года назад
Hmmm try to create a new file object with same path and delete that?
@harishdeore453
@harishdeore453 3 года назад
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 ?
@MikesTechCorner
@MikesTechCorner 3 года назад
Try to watch the other sftp and Spring videos that I have made.
@ShubhamSingh-uv6is
@ShubhamSingh-uv6is 6 месяцев назад
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?
@MikesTechCorner
@MikesTechCorner 6 месяцев назад
Look at cloud buckets instead. Then you don't have to maintain it. Software as a service rocks. :)
@selmathmundappilly6437
@selmathmundappilly6437 4 года назад
Hi friend, how can I download file on event-based (on demand) using Spring SFTP integration - InboundChannelAdapter, instead of listening to the SFTP server
@MikesTechCorner
@MikesTechCorner 4 года назад
Interesting topic. What kind of event? But yes you have to implement the custom code then
@sharathpoojary2535
@sharathpoojary2535 Год назад
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
@MikesTechCorner
@MikesTechCorner Год назад
I don't know. Why do you want to stop listenening for files? Just ignore extra files.
@angnguyen-vn2on
@angnguyen-vn2on Год назад
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.
@MikesTechCorner
@MikesTechCorner Год назад
You can open an output stream and then load the file as an input stream.
@nandakumarmudaliar5731
@nandakumarmudaliar5731 3 года назад
Hi, how can we download all the files from the remote directory during one poll? Loved your teaching bdw...
@MikesTechCorner
@MikesTechCorner 3 года назад
List the files and dl one by one
@nandakumarmudaliar5731
@nandakumarmudaliar5731 3 года назад
@@MikesTechCorner the session.list() to be done in ServiceActivator level or InboundChannelAdapter level???
@chandanbharadwaj7480
@chandanbharadwaj7480 3 года назад
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
@MikesTechCorner
@MikesTechCorner 3 года назад
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
@Feiret
@Feiret 4 года назад
hi friend! i have a trouble, my handleIncomingFile method didn`t call. can you help what`s wrong?
@MikesTechCorner
@MikesTechCorner 4 года назад
Clone my repo and check file by file and check whats missing. Check the log for errors. Ok?
@wasuvansundararajan6339
@wasuvansundararajan6339 Год назад
How to get notifications after deleted..? Please suggest some advice
@wasuvansundararajan6339
@wasuvansundararajan6339 Год назад
Please suggest can I listen the delete event after file got deleted..? Any filter implementation..?
@Higurashi86
@Higurashi86 2 года назад
is there a way for it to download files in subfolers as well?
@MikesTechCorner
@MikesTechCorner 2 года назад
Yes you have to list all folders and download the files 1 by 1. It's just a couple of loops / methods.
@navd1488
@navd1488 3 года назад
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
@MikesTechCorner 3 года назад
No delete the file or move to a folder named "done" or something. Regard cluster setup then the sftp instances would share same volumes
@navd1488
@navd1488 3 года назад
@@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
@MikesTechCorner
@MikesTechCorner 3 года назад
@@navd1488 no the file is not locked. Move it to a "inprog" folder or place a metainfo file next to it
@navd1488
@navd1488 3 года назад
@@MikesTechCorner thank you very much :)
@ikshitbohray1216
@ikshitbohray1216 Год назад
Is there way to delete files from the remote server based on a filter using spring integration?
@MikesTechCorner
@MikesTechCorner Год назад
You send delete request for each file.
@ikshitbohray1216
@ikshitbohray1216 Год назад
@@MikesTechCorner thanks i was able to find a way
@nshivakiran
@nshivakiran 3 года назад
how did you set up this filezilla for sftp, do u have another video for this?
@MikesTechCorner
@MikesTechCorner 3 года назад
Yes watch the sftp ssh key vid
@nshivakiran
@nshivakiran 3 года назад
@@MikesTechCorner Can you please provide the link here? Is this the one Spring Integration SftpMessageHandler Upload file through @MessagingGateway
@laksomphear9692
@laksomphear9692 2 года назад
Hello sir, How to disconnect and connect session in ftp?
@MikesTechCorner
@MikesTechCorner 2 года назад
Try to clone my git projects
@superman-yb3gi
@superman-yb3gi 8 месяцев назад
Hi what about the session closure...where we need to close
@MikesTechCorner
@MikesTechCorner 8 месяцев назад
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
@superman-yb3gi
@superman-yb3gi 8 месяцев назад
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
Далее
Spring Integration Sftp Create Directories on Start
21:53
Spring Boot and Sftp - Avoid ftp and ftps if possible
18:11
Spring Tips: Distributed Locks with Spring Integration
26:38
Narcissistic Family: Why Nobody Believes the Scapegoat
11:44
SFTP Spring download multiple files
37:27
Просмотров 4 тыс.
Spring Integration @ServiceActivator @Gateway
27:37
Просмотров 8 тыс.