Spring Batch FlatFileItemWriter - How to use stepExecution.jobId to generate file name

前端 未结 2 1894
不知归路
不知归路 2020-12-15 13:32

I have this FileWriter where I\'m trying to append the current Job Id to the filename that is generated.



        
2条回答
  •  感情败类
    2020-12-15 13:39

    The supported names for late-bindig are:

    • #{jobParameters}
    • #{jobExecutionContext}
    • #{stepExecutionContext}

    If jobId is not directly accessible, look this question.

    Also, resource can be injected directly as

    
      file://${csv.file}_#{jobExecutionContext['jobId']}
    
    

    because the right resource type is created using a converter.

提交回复
热议问题