From d7e7a72f015c748a4d3abfbe55b9e50f6c441aab Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Thu, 13 Oct 2022 11:55:27 +0200 Subject: [PATCH] Updated Spring Batch 5.0 Migration Guide (markdown) --- Spring-Batch-5.0-Migration-Guide.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Spring-Batch-5.0-Migration-Guide.md b/Spring-Batch-5.0-Migration-Guide.md index 7d8fc2c..c625975 100644 --- a/Spring-Batch-5.0-Migration-Guide.md +++ b/Spring-Batch-5.0-Migration-Guide.md @@ -207,6 +207,14 @@ Starting from v5, the default `ExecutionContextSerializer` was changed from `Jac The dependency to Jackson was made optional. In order to use the `JacksonExecutionContextStringSerializer`, `jackson-core` should be added to the classpath. +## SystemCommandTasklet updates + +The `SystemCommandTasklet` has been revisited in this release and was changed as follows: + +* A new strategy interface named `CommandRunner` was introduced in order to decouple the command execution from the tasklet execution. The default implementation is the `JvmCommandRunner` which uses the `java.lang.Runtime#exec` API to run system commands. This interface can be implemented to use any other API to run system commands. + +* The method that runs the command now accepts an array of `String`s representing the command and its arguments. There is no need anymore to tokenize the command or do any pre-processing. This change makes the API more intuitive, and less prone to errors. + ## Job parameters handling updates ### Support for any type as a job parameter