Java Spring集成-如何确定处理已完成
我在spring集成中定义了以下流:Java Spring集成-如何确定处理已完成,java,spring,spring-integration,Java,Spring,Spring Integration,我在spring集成中定义了以下流: 从给定目录中读取并删除消息(带有web服务请求) 将其转换为字符串 使用此消息发送web服务请求 流程定义如下所示 IntegrationFlows .from(inboundAdapter(getDirectory())) .transform(fileToString()) .handle(sendRequestToWS) .get(); 给定目录中的消息数
IntegrationFlows
.from(inboundAdapter(getDirectory()))
.transform(fileToString())
.handle(sendRequestToWS)
.get();
给定目录中的消息数量是固定的,我希望在所有消息都已处理完毕时通知用户
你知道我怎样才能知道流程“已经完成”了吗
FileReadingMessageSource
当目录中没有更多文件时,返回null。因此,我是否需要自定义实现FileReadingMessageSource
,当目录为空时,它将发送不同的消息,或者可能有更好的解决方案…子类化FileReadingMessageSource
来检测空值是否可行;或者您可以向轮询器添加自定义消息源建议-请参阅
智能轮询器也适用于使用XML配置的用户,在这种情况下,使用自定义
MessageSource
自定义FileReadingMessageSource
并不容易,谢谢。