How to use SSHClient as a service #795
Unanswered
guilhemferr
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, we're wrapping the library in a Spring Boot service like the following.
So clients would inject the
SFTPService
and callconnect
when they need to talk with the SFTP server. InternallySFTPConnection
provides some abstraction on top of the library, but mainly it implements a closable interface. So when it is closed we close the current connection and we calldisconnect
int he sshClient. I'm wondering what are the best practices to handle connections in the context of a bean? Is there any downside on holding a class instance ofSSHClient
already connected?Beta Was this translation helpful? Give feedback.
All reactions