
Originally Posted by
Dave Syer
If you are happy to forgo restartability it is trivial to make an ItemReader thread safe - just wrap the call to read() in a synchronized block. Then if your wrapper doesn't implement ItemStream you won't get that warning from the chunk monitor. Whether it helps in any given scenario is highly dependent on the details, and don't forget you lose restartability (but then you already did by using a multi-threaded step).
Best practice for restartable multi-threaded jobs involving file input is to load the file as quickly as possible into a relational database, and take it from there in parallel (as per parallel sample). If you job takes a week to finish this might be a classic example where the pre-load step is worth the extra work.
Chunk monitor is still there. It is really an internal implementation detail though, so don't rely on it always being there.