Description
nishant ranjan opened BATCH-2503 and commented
Skip exception class functionality is not working properly when MongoItemreader is being used.
Example:
<skippable-exception-classes>
<include class="org.springframework.core.convert.ConversionFailedException" />
</skippable-exception-classes>
Suppose 20 rows are fetched from MongoDB and at row number 15 configurable exception ".ConversionFailedException" is thrown from a custom class derived from Converter, (MessageContextReadConverter implements Converter<DBObject, MessageContext>)
. MessageContextReadConverter is set during mongoTemplate creation,.
Now, exception thrown at row number 15 is received in custom readlistener (public void onReadError(Exception ex)).
Issues:
- Spring batch is stuck at row number 15. It continuously calls MessageContextReadConverter and onReadError for same row number 15.
- skiplistener is never invoked.
Analysis:
MongoItemreader works on paging mechanism therefore skip functionality is not working.
Solution:
- Spring batch should provide MongoItem reader which is a cross implementation of both page and cursor techniques. Otherwise, reading each row from Mongo is huge task if data is large.
Kindly correct me if above analysis is in-correct.
I am implementing cursor based reader but again its not a solution as combination of cursor + paging is required.
Affects: 3.0.7