I am using Spring Package 2.1.5. I have many jobs that are very similar to each other, and I am looking for a way to have smaller XML acting as a job template.
What is shared between tasks is readers, processors, writers, and one object. Also, some parameters for each of these beans are the same. For example, they all use the same data source.
I was thinking about 4 approaches and 3 of them do not work ...
1 - Using a postprocessor to add generic beans and attributes as default values ββis not possible, because the Spring class, the JobParserJobFactoryBean package class is not a public class.
2 - Adding an XML extension seems wrong because I am not adding any custom tags to the XML file.
3 - Using the PropertyOverrideConfigurer property, I can put the default values ββin the properties, but I need to define these values ββfor each bean. Therefore, I will have many duplicate values, and I will only transfer the problem to the properties.
4 - Using some kind of custom factory bean. This seems to be the only choice, but I donβt know exactly how to connect it to the existing code.
Has anyone tried to do this? Can anyone give advice or recommend resources on how to do this?
source
share