Passing Data To Future Steps in case of temporary file paths and logger #4577
-
I'd like to get some advice on https://docs.spring.io/spring-batch/reference/common-patterns.html#passingDataToFutureSteps.
Is it a good idea to use the
|
Beta Was this translation helpful? Give feedback.
Answered by
fmbenhassine
Apr 15, 2024
Replies: 1 comment 2 replies
-
Yes I think so. Once the temporary folder is created, its path can be promoted to the job execution context so it can be shared with subsequent steps. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While the example in the reference documentation updates the key on every write (like updating a counter for instance), this is not necessary. In your case, if the preparation step is a simple tasklet that creates the temporary folder, then the path of the folder can be put in the job execution context only once.
Using a job parameter should work as well if the temporary folder is created before launching the job (to be able to pass the path of the folder as a job parameter).