代码之家  ›  专栏  ›  技术社区  ›  Makky

Spring集成SLA选项

  •  0
  • Makky  · 技术社区  · 6 年前

    我有一个springboot集成应用程序,它根据一些参数(如

    startTimeScan
    endTimeScan
    Days to scan 
    

    我使用的Cron表达式工作正常,但现在我遇到了一些客户机可能遇到的挑战 SLA cutoff 基本上,如果文件没有在那个时间到来,它会发出警报。

    Spring集成中有没有提供这种特性的选项?

    1 回复  |  直到 6 年前
        1
  •  1
  •   Artem Bilan    6 年前

    是的,那个 AbstractMessageSourceAdvice 实现可以用于这样的逻辑。你只需要实现它 afterReceive(Message<?> result, MessageSource<?> source) 并检查 null . 一段时间后,你会发出警报。

    唯一的问题是这个建议是从轮询任务执行的,因此在cron提到的时间间隔内执行。不幸的是,没有其他方法对丢失的事件做出反应。

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