An exception in an ItemWriter#close method is not causing the exit status to be marked as FAILED. Can you confirm that is the expected behavior ?
According to my understanding, when ItemWriter#close method is called, the items must have been processed successfully.
We encountered no errors during the phase of reader, processor or writer.
As as result, the exit status is marked as COMPLETED.
In other words, ItemWriter#close method is only useful for clean up of resources and does not impact the results of the step.
Do you agree with my explanation ? Can you confirm ?
Thank you in advance for your answers.
There is no
ItemWriter#close, it is ratherItemStream#close.ItemStream#closeis designed to clean up resources that were used in the step, and nothing more. If an exception is thrown in that method, all the relevant business processing should have been already done at this point so it should not cause a failure of the step.