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 exceptions, not errors. java discourages handling errors 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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -