Results 1 to 4 of 4

Thread: Passing extra parameters to reader, processor and writer

  1. #1
    Join Date
    Aug 2009
    Posts
    15

    Default Passing extra parameters to reader, processor and writer

    I have a scenario where I need to pass multiple parameters to itemreader, item processor and itemwriter.

    There parameters are independent of input and ouput parameters

    For example these are like bean reference of logging service which logs all the errors (again this is not regular log4j) in data to a different file.

    Errors can happen in reader, writer or processor.Again these parameters can't be set as bean reference. I need to pass as parameter to different steps within a job

    Is there any way to make itemreader, processor, writer to take extra parameters?


    -Shirny

  2. #2

    Default

    readers writers and processors are just regular spring beans so you can use the standard spring's dependency injection.

    If you want to pass Spring's specific parameters, you can use late binding as explained in the documentation
    http://static.springsource.org/sprin...l#late-binding

  3. #3
    Join Date
    Aug 2009
    Posts
    15

    Default

    But if I want to pass extra parameter to the processor
    As of now processor has input, output I want to pause another paramerter

  4. #4

    Default

    well, a processor is a spring bean. Inject whatever you need to using one of the standard Spring injection mechanisms

Tags for this Thread

Posting Permissions

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