I have different import jobs to get data into our system. Since the data is coming from different producers, i sometimes have csv data, or different formats of xml. Each of these import types has its own spring batch job with its own configuration (different readers, different processors but all the same writer).
My task now is, that i also need the "raw data" in my system and not only the converted objects. So for a csv import i want to have access to the raw line that builds up one entity. In XML i want the raw element as string. So the writer should be extended to take my converted object DTO plus an additional string with the raw data that was read.
I just can´t figure out how to access the raw data with spring batch. I tried several ways to get into the processing line with ItemReadListener#beforeRead or afterRead but i cannot access the raw data from the files.
Any ideas for what i can look further? Or tips on how to achive getting the raw data + the converted dto objects?