英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论