Announcement Announcement Module
Collapse
No announcement yet.
How to pass parameters to the spring batch job? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to pass parameters to the spring batch job?

    I think I can pass the the parameters through JobParameters object.

    But If I need to retrieve the parameters in the ItemReader or ItermWriter, what should I do?

    who can help me, thank you!

  • #2
    You can get the JobParameters from the StepExecution, which can be accessed via a listener:

    http://static.springframework.org/sp...n.html#d0e3618

    Comment


    • #3
      Thank you for your help. And I think I can get the parameter from the StepExecution and pass them to the reader and writer using ExecutionContext, is that right?

      Comment


      • #4
        Your readers and writers can also be StepExecutionListeners.

        Comment

        Working...
        X