【问题标题】:Spring Integration - reprocess messages from inbound file adapter by default after server restartSpring Integration - 服务器重启后默认重新处理来自入站文件适配器的消息
【发布时间】:2015-04-28 04:38:24
【问题描述】:

我有一个连接到文件出站网关的文件入站适配器。下面是配置。

*

*

当天早些时候在一个实例上按预期处理了一堆文件。另一个实例由于某种原因重新启动,几小时后它开始处理已经在另一个实例上处理的消息。它导致出站网关的每条消息都出现 filenotfound 异常

2015-02-19 00:46:15,761 [task-scheduler-8] INFO org.springframework.integration.file.FileWritingMessageHandler - 无法移动文件“/tcserver/mounts/file_int/source/b31d688bc85c429bb4748f56a38f4e61”。使用复制和删除后备。

2015-02-19 00:46:15,762 [task-scheduler-8] 调试 org.springframework.integration.handler.LoggingHandler -(内部 bean)#8 收到消息:[Payload=org.springframework.integration.MessageHandlingException : 无法将消息负载写入文件][Headers={timestamp=1424328375761, id=ad494ba5-795f-40d0-b523-74998088028e}]

2015-02-19 00:46:15,762 [task-scheduler-8] 错误 org.springframework.integration.handler.LoggingHandler - org.springframework.integration.MessageHandlingException:无法将消息有效负载写入文件 在 org.springframework.integration.file.FileWritingMessageHandler.handleRequestMessage(FileWritingMessageHandler.java:293) 在 org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:134) 在 org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73) .....

原因:java.io.FileNotFoundException: /tcserver/mounts/file_int/source/b31d688bc85c429bb4748f56a38f4e61(没有这样的文件或目录) 在 java.io.FileInputStream.open(本机方法) 在 java.io.FileInputStream.(FileInputStream.java:146) 在 org.springframework.util.FileCopyUtils.copy(FileCopyUtils.java:63) 在 org.springframework.integration.file.FileWritingMessageHandler.handleFileMessage(FileWritingMessageHandler.java:352) 在 org.springframework.integration.file.FileWritingMessageHandler.handleRequestMessage(FileWritingMessageHandler.java:277)

1) spring 是否在服务器系统关闭之前保存系统状态。 2)任何解释为什么会发生这种情况都会有很大帮助

【问题讨论】:

  • 跨度>

标签: java spring file-io spring-integration messaging


【解决方案1】:

如果您有多个实例引用同一个源目录,则需要使用持久文件列表过滤器以及 MetadataStore(例如 Redis)在实例之间共享状态。

the documentation

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-12
    • 1970-01-01
    • 2017-11-10
    • 2018-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多