Results 1 to 4 of 4

Thread: How to pass parameters to the spring batch job?

  1. #1
    Join Date
    Apr 2008
    Posts
    9

    Default 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. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

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

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

  3. #3
    Join Date
    Apr 2008
    Posts
    9

    Default

    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?

  4. #4
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    Your readers and writers can also be StepExecutionListeners.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •