Home > Net >  How to use two readers with same process in spring batch
How to use two readers with same process in spring batch

Time:02-10

I have 2 files one is csv and the other is json file. My processor reads item from csv processes it and writes to json. I have one other json file which is a look up table. I want to add the logic of processing only those items from csv which does not exist in json. I have the following processor which does transformation on items from csv:

    @Override
    public foo process(final foo Foo) throws Exception {

        final String websiteName = foo.getWebsite_name();
        foo.setHost(websiteName);
        String regexString = String.format("(.\\.|^)%s($|\\/.)", websiteName);
        foo.setRegex(regexString);
        }

My json file is of the following format:

{"websiteName": key}

I want to only process those items whose websiteName exists in json. Any ideas how I can add this into my existing processor. I don't want to read json file inside the processor as it would read with every item.

CodePudding user response:

  •  Tags:  
  • Related