RESOLVED - issue BATCH-532: StepExecutionListener can influence exit status but not status of step execution
removed the try/catch block around listener.afterStep() updated javadoc for StepExecutionListener#afterStep(..)
This commit is contained in:
@@ -48,6 +48,9 @@ public interface StepExecutionListener extends StepListener {
|
||||
* returned will be combined with the normal exit status using
|
||||
* {@link ExitStatus#and(ExitStatus)}.
|
||||
*
|
||||
* Called after successful execution of step's processing logic. Throwing
|
||||
* exception in this method will cause step to fail.
|
||||
*
|
||||
* @return an {@link ExitStatus} to combine with the normal value. Return
|
||||
* null to leave the old value unchanged.
|
||||
*/
|
||||
|
||||
@@ -137,12 +137,7 @@ public class TaskletStep extends AbstractStep implements Step, InitializingBean,
|
||||
|
||||
listener.beforeStep(stepExecution);
|
||||
exitStatus = tasklet.execute();
|
||||
try {
|
||||
exitStatus = exitStatus.and(listener.afterStep(stepExecution));
|
||||
}
|
||||
catch (Exception e) {
|
||||
logger.error("Encountered an error on listener close.", e);
|
||||
}
|
||||
exitStatus = exitStatus.and(listener.afterStep(stepExecution));
|
||||
|
||||
try {
|
||||
jobRepository.saveOrUpdateExecutionContext(stepExecution);
|
||||
|
||||
Reference in New Issue
Block a user