简体   繁体   English

使用Akka在春季安排的工作

[英]Scheduled Jobs in Spring using Akka

I am trying to determine the best way to implement handling long running batch jobs in Spring MVC. 我正在尝试确定在Spring MVC中实现处理长时间运行的批处理作业的最佳方法。 I come across Akka in my searching as a non blocking framework for aync processing, which is preferred because I don't want the batch processing to eat up all the threads from the thread pool. 我在搜索时遇到了Akka,它是用于aync处理的非阻塞框架,因此首选Akka,因为我不希望批处理吞噬线程池中的所有线程。

Essentially what I will be doing is have a job that needs to run on some set schedule that will go out and call various web services, process the data, and persist it. 从本质上讲,我将要做的工作是按照一定的时间表运行,该时间表将退出并调用各种Web服务,处理数据并将其持久化。

I have seen some code example with using it with Spring, but I've never seen it used with a CRON type scheduler. 我已经看到了将代码与Spring一起使用的一些代码示例,但是我从未见过将它与CRON类型的调度程序一起使用。 It always seems to be using a fixed time period. 它似乎总是使用固定的时间段。

I'm not sure if this is even the best approach to handling large scale batch processing within Spring. 我不确定这是否是在Spring中处理大规模批处理的最佳方法。 Any suggestions or links to good Akka Spring resources are welcome. 欢迎提供任何建议或指向Akka Spring优秀资源的链接。

I would suggest you to look into Spring Integration and Spring Batch projects. 我建议您研究一下Spring IntegrationSpring Batch项目。 The first one allows you configure chains of services using EIP. 第一个允许您使用EIP配置服务链。 We used it in or project to fetch files from FTP, deserialize and process them, import into DB, send emails if required etc. - all by schedule. 我们在项目中使用它或从FTP中获取文件,反序列化和处理它们,导入到DB,如果需要发送电子邮件等。 The second one is more straightforward and basically provides a framework to work on rows of data. 第二个更直接,并且基本上提供了处理数据行的框架。 Both are configurable with Quartz and integrate into Spring MVC project nicely. 两者都可以使用Quartz进行配置,并且可以很好地集成到Spring MVC项目中。

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

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