way to pin point failed item in a chunk during write in spring batch -
what ways log exact item failed during writing chunk of 10 items size ?
is there way catch in onwriteerror method of itemwritelistener ? possible know extending itemwriter interface ?
thanks , regards, nik
you configure skip logic integer.max_value = 2.147.483.647
<step id="step1"> <tasklet> <chunk reader="flatfileitemreader" writer="itemwriter" commit-interval="10" skip-limit="2147483647"> <skippable-exception-classes> <include class="org.springframework.batch.item.file.flatfileparseexception"/> </skippable-exception-classes> </chunk> </tasklet> <listeners> <listener ref="customskiplistener" /> </listeners> </step>
and use skip listener (see annotations there too) log bad items during writing
if writer custom implementation, extended listener responds onskipinwrite only, add method @onskipinwrite , register writer listener (*)
(*) beware - if writer stream too, not register listener, streams automatically registered (step)listeners
Comments
Post a Comment