简体   繁体   English

Spring Integration SLA选项

[英]Spring Integration SLA option

I have a springboot integration application that listen for the files in the directory based on some parameter like 我有一个springboot集成应用程序,该应用程序根据一些参数来监听目录中的文件,例如

startTimeScan
endTimeScan
Days to scan 

I am using Cron expression that works fine but now I have a challenge that some of the clients would have SLA cutoff time basically if the file don't come by that time it will raise an alert. 我使用的Cron表达式可以正常工作,但是现在我面临一个挑战,即如果文件没有SLA cutoff时间,则某些客户端将基本上具有SLA cutoff时间,这将引发警报。

Is there any option in Spring Integration that kind of provide this feature? Spring Integration中有没有提供这种功能的选项?

Yes, the AbstractMessageSourceAdvice implementation can be used for such a logic. 是的, AbstractMessageSourceAdvice实现可用于这种逻辑。 You just need to implement its afterReceive(Message<?> result, MessageSource<?> source) and check for the message for null . 您只需要实现其afterReceive(Message<?> result, MessageSource<?> source)并检查消息是否为null After some period you raise an alert. 一段时间后,您会发出警报。

Only the problem that this advice is executed from the polling task, therefore in the interval mentioned by your cron. 仅在轮询任务中执行此建议的问题,因此仅在cron提到的间隔内执行。 Unfortunately there is no other way react to the missing event. 不幸的是,没有其他方法可以对丢失的事件做出反应。

https://docs.spring.io/spring-integration/docs/5.0.8.RELEASE/reference/html/messaging-channels-section.html#conditional-pollers https://docs.spring.io/spring-integration/docs/5.0.8.RELEASE/reference/html/messaging-channels-section.html#conditional-pollers

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM