Skip to content

Allow configuring SFTP max packet size #9380

Closed
@gbaso

Description

@gbaso

Expected Behavior

Provide a property on the DefaultSftpSessionFactory that allows to configure the max packet size:

DefaultSftpSessionFactory factory = new DefaultSftpSessionFactory()
factory.setMaxPacketSize(maxPacketSize);

Current Behavior

Max packet size is not configurable via DefaultSftpSessionFactory. It defaults to 32KB according to org.apache.sshd.core.CoreModuleProperties#DEFAULT_MAX_PACKET_SIZE. To change it, you must create your own SshClient and update the property:

SshClient sshClient = SshClient.setUpDefaultClient();
PropertyResolverUtils.updateProperty(sshClient, "packet-size", <value>);

however this prevents the DefaultSftpSessionFactory to initialize the client via doInitInnerClient(), therefore the ServerKeyVerifier, PasswordIdentityProvider, KeyIdentityProvider and UserInteraction must also be configured on the client instead of relying on the cleaner API from the DefaultSftpSessionFactory.

Context

I need to change the max packet size in order to reduce the amount of remote calls for more data in my Sftp.inboundStreamingAdapter integration flow, due to complaints from our SFTP server maintainer. Alternatively, we could reduce the rate at which we read from the remote InputStream, but that would slow down and add complexity to the integration flow

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions