Feb 27th, 2010, 09:21 AM
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?
Feb 28th, 2010, 01:51 AM
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
Mar 2nd, 2010, 06:04 PM
But if I want to pass extra parameter to the processor
As of now processor has input, output I want to pause another paramerter
Mar 3rd, 2010, 07:02 AM
well, a processor is a spring bean. Inject whatever you need to using one of the standard Spring injection mechanisms
Tags for this Thread