How to get access to job parameters from ItemReader, in Spring Batch?

前端 未结 7 1651
梦谈多话
梦谈多话 2020-11-30 23:29

This is part of my job.xml:


  
    

        
7条回答
  •  离开以前
    2020-12-01 00:07

    To be able to use the jobParameters I think you need to define your reader as scope 'step', but I am not sure if you can do it using annotations.

    Using xml-config it would go like this:

    
      
    
    

    See further at the Spring Batch documentation.

    Perhaps it works by using @Scope and defining the step scope in your xml-config:

    
    

提交回复
热议问题