我们的系统使用以下Spring集成轮询太慢
<int-file:inbound-channel-adapter
directory="file:#{'${poller.landingzonepath}'.toLowerCase()}" channel="createMessageChannel"
filename-regex="${ingestion.filenameRegex}" queue-size="10000"
id="directoryPoller" scanner="leafScanner">
<!-- <int:poller fixed-rate="${ingestion.filepoller.interval:10000}" max-messages-per-poll="100" /> -->
<int:poller fixed-rate="10000" max-messages-per-poll="1000" />
</int-file:inbound-channel-adapter>
我们也有从默认RecursiveLeafOnlyDirectoryScanner延伸leafScanner,我们leafscanner没有做太多Spring集成项目。只需针对正则表达式属性检查一个目录。
我们看到的问题是存在250,000个(.landed [我们关心的文件]文件),这意味着我们正在轮询的目录中有大约500k个实际文件。这是对旧系统的重新设计,重新设计使应用程序更具可扩展性,同时不受轮询父目录内的目录名称的影响。我们想要摆脱每个特定目录的轮询器,但似乎除非我们做错了什么,否则我们必须回到这个问题。
如果有人有任何可能的解决方案或配置项目,我们可以尝试请让我知道。在我的本地机器上安装了66k的.lan文件,大约需要16分钟才能将第一个文件提交给我们的变压器来做某件事。
是的,我读到了有关RecursiveLeafOnlyDirectoryScanner的内容,但找不到任何提到的上限。 – John