[
https://issues.apache.org/jira/browse/CAMEL-27915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18153457#comment-18153457
]
Guillaume Nodet commented on CAMEL-27915:
-----------------------------------------
This issue is being investigated by a coding agent (on behalf of gnodet).
Root cause confirmed: `MinaSftpOperations.configureBufferSizes()` correctly
stores `SftpModuleProperties.READ_BUFFER_SIZE` and `WRITE_BUFFER_SIZE` as
session properties, but MINA SSHD only reads those properties from
`SftpFileSystemProvider` (the `java.nio.FileSystem` path), not from
`SftpClient.read()/write()`. The actual read/write calls use
`sftpClient.read(name)` and `sftpClient.write(name, modes)` which chain through
default interface methods passing `bufferSize=0`, causing MINA SSHD to fall
back to the channel packet size (~32KB). The fix is to pass the configured
buffer sizes explicitly: `sftpClient.read(name, readBufferSize)` and
`sftpClient.write(name, writeBufferSize, modes)`. The `bulkRequests` option is
similarly never applied.
_Note: This comment was generated by an AI coding agent and requires manual
verification._
> camel-mina-sftp: readBufferSize, writeBufferSize and bulkRequests have no
> effect
> --------------------------------------------------------------------------------
>
> Key: CAMEL-27915
> URL: https://issues.apache.org/jira/browse/CAMEL-27915
> Project: Camel
> Issue Type: Bug
> Components: camel-mina-sftp
> Reporter: Claus Ibsen
> Assignee: Guillaume Nodet
> Priority: Minor
> Fix For: 4.25.0
>
>
> Found while improving the option descriptions of camel-mina-sftp for
> CAMEL-23832 (pull request https://github.com/apache/camel/pull/31179).
> These are separate problems of the component; the descriptions change only
> documents the current behavior.
> h4. 1. readBufferSize, writeBufferSize and bulkRequests have no effect
> {{MinaSftpOperations.configureBufferSizes}} sets SftpModuleProperties
> READ_BUFFER_SIZE and WRITE_BUFFER_SIZE on the session, but in MINA SSHD
> 2.20.0 only SftpFileSystemProvider reads them. The component calls
> sftpClient.read(name) and write(name[, modes]), which pass buffer size 0, so
> the client uses the channel packet size. SftpBulkRequestsIT only checks that
> the values are parsed.
> Proposed change: pass the size with read(name, size) and write(name, size,
> modes); MINA rejects sizes below 256.
> h4. 2. Maximum buffer size
> MAX_BUFFER_SIZE is 126*1024+512 = 129536, its comment says 124*1024+512, and
> the option text and doc page said 126976. The "SFTP Buffer Size
> Configuration" section of the doc page presents the buffer sizes as working.
> Proposed change: decide the cap and update the doc page with the fix.
> h4. 3. Options inherited from camel-ftp-common
> timeout and soTimeout are not used (the MINA command timeout of 30 s
> applies), the compression level is ignored (any value > 0 offers zlib), and
> bulkRequests is deprecated in mina-sftp but not in the metadata, as the field
> is in BaseSftpConfiguration.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)