Skip to main content

SFTP Integration

SFTP is the primary file transport protocol for enterprise partners. The platform supports both directions: inbound (we poll and download) and outbound (we push after transform).

Library Choice​

LibraryVerdict
JSchWidely used, stable, but unmaintained (use fork com.github.mwiede:jsch)
Apache MINA SSHDActively maintained, full SSH2, better for connection pooling β€” recommended
sshjModern, clean API, good alternative

Use Apache MINA SSHD (org.apache.sshd:sshd-sftp). It supports connection multiplexing, key exchange algorithms needed by modern servers, and a proper connection pool abstraction.

Inbound (Download) Flow​

Outbound (Send) Flow​

Connection Pool Design​

  • Each SftpConnector owns its pool (max size configurable, default 3)
  • Sessions are validated before borrow (send keep-alive / test channel)
  • On validation failure: recreate session, re-authenticate
  • Pool is torn down when integration is deleted or updated

Authentication Options​

Prefer private key auth for production β€” passwords are susceptible to brute force and rotation is harder.

File Acknowledgement Strategy​

StrategyConfigWhen to use
Move to /processedmoveToPath: "/archive/processed"Partner needs to verify delivery
Move to /errorAutomatic on pipeline failureQuarantine bad files
Delete after downloaddeleteAfterDownload: trueSimplest, no archive needed
Leave in placeDefault (no config)When partner manages cleanup

SFTP Config Example​

{
"name": "Bank ABC Inbound Transactions",
"type": "SFTP",
"direction": "INBOUND",
"config": {
"host": "sftp.bankabc.com",
"port": 22,
"username": "transform_svc",
"remotePath": "/outbound/transactions/",
"filePattern": "*.csv",
"pollIntervalSeconds": 300,
"moveToPath": "/outbound/transactions/processed",
"authMethod": "PRIVATE_KEY"
},
"credentials": {
"privateKey": "-----BEGIN RSA PRIVATE KEY-----\n...",
"passphrase": "optional"
}
}
warning

The credentials object in the request is write-only. It is encrypted immediately on receipt and never returned in GET responses.