Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spring Batch flow job Vs spring composed task

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?

like image 688
jignesh vaghela Avatar asked Jun 06 '17 10:06

jignesh vaghela


2 Answers

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.

like image 82
Michael Minella Avatar answered Sep 21 '22 06:09

Michael Minella


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.

like image 31
Dean Clark Avatar answered Sep 22 '22 06:09

Dean Clark