spring Batch flow job Vs spring composed task

江枫思渺然 提交于 2021-01-21 08:57:25

问题


I want to execute my apps using spring-complex-task and I have already build complex spring-batch Flow Jobs which executes perfectly fine.

could you please explain what is difference between spring Batch flow job Vs spring composed task? and which is best among them?


回答1:


A composed task within Spring Cloud Data Flow is actually built on Spring Batch in that the transition from task to task is managed by a dynamically generated Spring Batch job. This model allows the decomposition of a batch job into reusable parts that can be independently tested, deployed, and orchestrated at a level higher than a job. This allows for things like writing a single step job that is reusable across multiple workflows.

They are really complimentary. You can use a composed task within Spring Cloud Data Flow to orchestrate both Spring Cloud Tasks as well as Spring Batch jobs (run as tasks). It really depends on how you want to slice up your process. If you have processes that are tightly coupled, package them as a single job. From there, you can orchestrate them with Spring Cloud Data Flow's composed task functionality.




回答2:


In general, there's not one that's "better". It's going to be dependent on your use case and requirements.

Spring Batch is a nice framework to run batch processing applications.

Spring Cloud Task is a wrapper that allows you to run short lived microservices using Spring Cloud along with Spring Boot. Once you setup a test with @EnableTask it will then launch your *Runner. The framework also comes with Spring Batch integration points and ComposedTaskRunner helps facilitate that integration.

I'd start with the Spring Cloud Task batch documentation and then come back to ask more specific questions.



来源:https://stackoverflow.com/questions/44386991/spring-batch-flow-job-vs-spring-composed-task

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!