如何为SFTP入站端点设置单次轮询的最大文件处理数量?
Limit SFTP Inbound Endpoint Polling File Count
Absolutely! You can fix this overload issue by setting a maximum number of files to fetch per poll using the maxMessagesPerPoll attribute in your SFTP inbound endpoint configuration. This is a built-in Mule feature specifically designed to prevent exactly the kind of performance hit you're seeing when hundreds of files get processed in one go.
Here's how to update your configuration to add this limit:
<sftp:inbound-endpoint sizeCheckWaitTime="${sizeCheckWaitTime}" connector-ref="ImportInformationStatusSFTP" host="${sftp.host}" port="${sftp.port}" path="${sftp.path}" user="${sftp.user}" password="${sftp.password}" responseTimeout="${sftp.responseTimeout}" archiveDir="${mule.archiveDir}${sftp.archiveDir}" archiveTempReceivingDir="${sftpconnector.archiveTempReceivingDir}" archiveTempSendingDir="${sftpconnector.archiveTempSendingDir}" tempDir="${sftp.tempDir}" doc:name="SFTP" pollingFrequency="${sftp.poll.frequency}" maxMessagesPerPoll="50"> <!-- Adjust this number to match your app's processing capacity --> <file:filename-wildcard-filter pattern="*.xml"/> </sftp:inbound-endpoint>
Key Details:
- The
maxMessagesPerPollvalue sets the upper limit of files retrieved and processed in one polling cycle. Any leftover files on the SFTP server will be picked up in subsequent polls. - Start with a conservative number (like 50 in the example) and tweak it based on real-world performance. If your app still slows down, lower the value; if files start piling up too quickly, gradually increase it until you find the right balance between throughput and stability.
- This attribute works across most Mule inbound endpoints (File, FTP, etc.), so it’s a consistent way to control polling load no matter the source.
内容的提问来源于stack exchange,提问作者Stole
相关产品推荐
相关产品推荐

