I'm trying to get SkipLimitStepFactoryBean to work with StaxEventItemReader but can't seem to get it right.

I've setup a skip limit step which uses a StaxEventItemReader as a reader. When a skippable exception is thrown out of my deserializer, the record number is added to the reader skipRecords list, the chunk iteration is terminated and a new step iteration starts.

Right before processing a new chunk, ItemOrientedStep calls itemHandler.mark() which delegates to StaxEventItemReader which clears the skipRecords list, so StaxEventItemReader will only progress to the end of the current fragment and think there are no more fragments to process.

Is this a bug or did I get it wrong?

I think either the reader should be seeked to the next fragment before calling mark(), or the skip limit exception handler should be set on the chunkOperations instead of the stepOperations.