春季Web和春季批处理的兼容性?

huangapple go评论53阅读模式
英文:

spring web and spring batch compatibility?

问题

我在公司有一个正在使用Spring Web的项目,他们要求我做一个批处理作业,希望在其中实现Spring Batch。我已经尝试去详细制定它,但总是出现错误,无法启动Web服务器。我想知道在同一个项目中同时运行Spring Web和Spring Batch是否兼容。

英文:

I have a project in the company that is running with spring web, they asked me for a batch job in which they want to implement spring batch. I have tried to elaborate it but it always gives me an error The web server cannot be started.
I would like to know if spring web is compatible with spring batch running at the same time in the same project

答案1

得分: 0

是的,它们是兼容的。你能否发布一下你遇到的错误?

顺便说一下,如果可能的话,考虑在你的项目上使用 @Schedule。

@Scheduled(fixedRate = 1000)
public void executeJob() {

}

在某些情况下,它可以解决问题,这样你就不需要添加中间件来增加业务复杂性。

英文:

Yes, they are compatible. Can you post the error that you got?

By the way, consider to use @Schedule on you project, if it's possible.

@Scheduled(fixedRate = 1000)
public void executeJob() {

}

In some cases, it resolves the problem and you don't need to put a middleware to increase complexity to you business.

huangapple
  • 本文由 发表于 2020年9月26日 05:08:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/64071353.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定