java - Spring Batch - Recovery after Error -
i have spring batch job itemprocessor
can possibly fail exception. if happens have itemprocesslistener
in place handles recovery (marking item failed not picked in next run).
that solution works charm 'regular' exceptions, i've experienced java.lang.outofmemoryerror: java heap space
error onprocesserror()
not called , item not excluded in next run.
i noticed jobexecutionlistener.afterjob()
called job parameters of failed execution , query all items of execution again , mark them failed.
is there better approach problem?
basically onprocesserror
ill-named. listens exception
s, not error
s. java discourages handling error
s via catch-blocks. reason is, jvm signals fault not in programming in configuration of vm via error
. should taken strong indicator, vm-setup needs correction.
in case, write outofmemoryerror
occurs if memory demand higher memory, has been assigned java-job via -xmx/xms startparameters. either assign little memory or consume of it. should fixed, not caught via technical trick.
first of all, should find out causes error. maybe need assign more memory, of algorithms greedy in memory consumption , not unlikely, have memory leak root cause.
wiki
Comments
Post a Comment