Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
FlatFileItemRead isnt respecting the maxitemcounter [BATCH-2801] #805
I'm doing a process with Spring Batch multi-thread. My process receives a large txt file (> 100k lines). I want each thread to process X lines of the file and do X process with the information to gain time.
I am using the FlatFileItemRead class passing the initial and final line to each thread. I'm doing tests with 19k lines, 3 and 4 threads and I cannot see why the first thread if it starts and stops in the correct line, but the rest of threads start in the correct line but not end in the correct one, read the file until the end.
The xml configuration and the rangepartitioner files are attached.
My example with 19k lines in file and 3 threads:
Thread 1 reads up to 6333. Thread 2 reads up to 19000 instead of reading up to 12666 and thread 3 reads up to 19000.
You can see an example created by Mahmoud Ben Hassine on his GitHub see this
His example (15 lines in file and 3 threads):
Affects: 2.1.9, 4.1.1